-
Notifications
You must be signed in to change notification settings - Fork 776
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Generate JSON Survey Schema - Bugs found #6227
Comments
@BinoDino I believe I have fixed everything, except localization string class. Thank you, |
@andrewtelnov Thank you very much for your fast feedback. I really appreciate that. I think the only way to define the localization string class would be like this: {
"definitions": {
"localization": {
"type": "object",
"$id": "localization",
"properties": {
"default": {
"type": "string"
},
"ca": {
"type": "string"
},
"cy": {
"type": "string"
},
"da": {
"type": "string"
},
"de": {
"type": "string"
},
(and so on)
}
}
}
} and then reference it like this (properties and definitions): {
"properties": {
"title": {
"oneOf": [
{ "type": "string"},
{ "$ref": "#/definitions/localization"}
]
}
},
"definitions": {
"itemvalue": {
"type": "object",
"properties": {
"text": {
"oneOf": [
{ "type": "string" },
{ "$ref": "localization#" }
]
}
}
}
}
} |
@andrewtelnov sorry to write again, but I have found more bugs on the JSON schema. The issues are the following:1. Wrong data types
{
"description":{
"question": {
"properties": {
"showCommentArea": {
"type": "string"
},
"isRequired": {
"type": "string"
},
"readOnly": {
"type": "string"
}
}
}
}
}
2. Double listing of properties Example 1 ( {
"definitions": {
"selectbase": {
"allOf": [
{"$ref": "question#"},
{ "properties": {
"showCommentArea": {
"type": "string"
}
}
}
]
}
}
} See also in
Example 2 ( {
"definitions": {
"expression": {
"allOf": [
{"$ref": "question#"},
{ "properties": {
"isRequired": {
"type": "string"
},
"readOnly": {
"type": "string"
}
}
}
]
}
}
} See also in
3. Double listing and wrong data type on second listing Initially {
"definitions": {
"selectbase": {
"allOf": [
{"$ref": "question#"},
{ "properties": {
"separateSpecialChoices": {
"type": "boolean"
}
}
}
]
},
"checkboxbase": {
"type": "object",
"$id": "checkboxbase",
"allOf": [
{
"$ref": "selectbase#"
}
]
}
}
} Here it is a {
"definitions": {
"radiogroup": {
"allOf": [
{
"$ref": "checkboxbase#"
},
{
"properties": {
"separateSpecialChoices": {
"type": "string"
}
}
}
]
},
"checkbox": {
"allOf": [
{
"$ref": "checkboxbase#"
},
{
"properties": {
"separateSpecialChoices": {
"type": "string"
}
}
}
]
}
}
} |
@andrewtelnov Thank you very much for your efforts! 🙂 Will notify you if I come across anything else. |
@andrewtelnov Sorry, I have something else - it's rather a question (or maybe a bug?): I noticed that in the JSON schema there is no property Moreover, I noticed that there are no required Schema fields at all. But isn't it for example like this:
|
@BinoDino I have added "type" property into "#question" and "#panel". It supports "required" array attribute as well. Thank you, |
@andrewtelnov Thank you very much for the latest version of the surveyjs schema. I really appreciate your fast reply and fixes. I tested it today. Unfortunately I found two issues that were not fixed yet. The issues are the following1. Error message:
|
@BinoDino Regarding the second issue. Do you mean that all "$id" for all defintions should not have "#" symbol? Thank you, |
@andrewtelnov To your question: yes, that is correct. |
@andrewtelnov sorry for my late answer. Your commits look good as far as I can evaluate 👍 Thank you so so much! |
@BinoDino Super, we are going to release v1.9.90 today. Thank you, |
Generate JSON Survey Schema - Bugs found
Hi,
I am currently working with the surveyjs form library. I used the
Survey.Serializer.generateSchema()
method in order to create the JSON schema for the survey. That is when I encountered some bugs in the schema + got error message "schema is invalid" usingAjv
library.Would be great if you could take a look at it 🙂 Sorry for the long message and thank you!
current schema
property
visible
properties
title
anddescription
empty
enum
properties in schemaproperties
questions
(and others)references
$id
:in
properties
:in
definitions
:missing schemas
in
definitions/selectbase/allOf/{1}/properties/choicesByUrl
:in
definitions/text/allOf/{1}/properties/dataList
:expected schema
property
visible
visible
is of typeboolean
.properties
title
anddescription
title
anddescription
(and others?) are either a string or a translation object.empty
enum
properties in schemaempty
enum
properties are not allowedproperties
questions
(and others)Syntax error. Must be
anyOf
:Also affected:
triggers
defintions/panelbase/properties/elements
defintions/question/properties/validators
defintions/matrixdropdowncolumn/properties/validators
defintions/multipletextitem/properties/validators
definitions/nonvalue/allOf/{1}/properties/validators
definitions/paneldynamic/allOf/{1}/properties/templateElements
references
$id
- no hash symbol#
in
properties
- path is#/definitions/id
:in
definitions
- hash symbol#
after id name:missing schemas
provide missing schemas
choicesRestful
andstring
Specifications
The text was updated successfully, but these errors were encountered: