-
Notifications
You must be signed in to change notification settings - Fork 639
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
patternProperties in editor #811
Comments
Could you elaborate further? I do not understand the problem. |
hi @svsolopov
|
I suspect what @svsolopov meant was that if one is to use "additionalProperties": true it allows for creating arbitrary properties, not just a property that fall within the defined patternProperties. The original intention may have been that the "keys" are only allowed to be strings consisting of numbers, and all other keys (apart from those specified in the properties section) are invalid. |
The don't display because there are no properties defined in the schema and "additionalProperties" is set to false. If you set it to true and add properties with number keys it works |
I think my explanation is unclear. This is the schema:
And this is the JSON.
"foo" is valid because we allow additional properties, but it shouldn't be because it doesn't match the pattern "^[0-9]+$" |
Now is clear, and yes the logic should be completed, based on this spec https://json-schema.org/understanding-json-schema/reference/object.html |
(Kindly ignore my commits referencing this issue.)
The proper fix would be to support |
PRs welcome ;) we currently only fully support up to v4 |
Fixed by #915 |
Object with patternProperties not show in editor
Direct link to example: https://json-editor.github.io/json-editor/
Valid result
{"0":{"code":"1"},"1":{"code":"1"},}
The text was updated successfully, but these errors were encountered: