Skip to content

Commit

Permalink
fix: ngx form json schema definition (#378)
Browse files Browse the repository at this point in the history
* fix: ngx form json schema definition

* fix: widgetType json schema definition

* fix: allow the use of numbers in visibleIf

* feat: ensure that the custom widget id is not blank
  • Loading branch information
Guillem CANAL authored Dec 17, 2020
1 parent 29d5135 commit 42fe804
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions schema/ngx-schema-form-schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,17 @@
"$comment": "Definition of all types supported by ngx-schema-form",
"title": "JSON Schema ngx-schema-form",
"type": "object",
"$ref": "#/definitions/formWidgetType",
"allOf": [
{
"$ref": "#/definitions/formWidgetType"
},
{
"$ref": "http://json-schema.org/draft-07/schema#"
}
],
"definitions": {
"widgetTypeCustom": {
"type": "string",
"$ref": "#/definition/stringNotBlank",
"description": "[NSF] - The name of custom widget type to use"
},
"widgetTypeSimple": {
Expand Down Expand Up @@ -50,7 +52,7 @@
"properties": {
"id": {
"description": "[NSF] - The id of the widget.",
"oneOf": [
"anyOf": [
{
"$ref": "#/definitions/widgetTypeSimple"
},
Expand Down Expand Up @@ -206,6 +208,9 @@
},
{
"type": "null"
},
{
"type": "number"
}
]
}
Expand All @@ -219,7 +224,7 @@
"description": "[NSF] - The form title of the root form. Will only be showed when is an inline form"
},
"widget": {
"oneOf": [
"anyOf": [
{
"$ref": "#/definitions/widgetTypeSimple"
},
Expand Down Expand Up @@ -270,6 +275,11 @@
"type": "object",
"description": "[NSF] - A form widget.",
"additionalProperties": true
},
"stringNotBlank": {
"type": "string",
"pattern": "^\\S*$",
"minLength": 1
}
}
}

0 comments on commit 42fe804

Please sign in to comment.