-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Document a gotcha with additionalProperties
#1018
Conversation
Thanks for submitting this, and sorry for taking so long to respond to it. This reads like a pretty mild warning but it almost sounds like it's describing a bug. Is it actually a bug? Is using |
#848 has a pretty good example of the behaviour. Using Either way, it is a limitation that seems to be commonly encountered, so it should be more clearly documented. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add it to the FAQ instead of "schema support status"? "Schema dependencies" as a concept is kind of unique to rjsf.
Can we write up a definitive issue explaining what the issue is and why we believe it will be hard to fix, and link to that? We can pick one of the existing three issues or we can create a new one, but the others should be closed as dupes of the definitive one.
@@ -1744,6 +1744,7 @@ This component follows [JSON Schema](http://json-schema.org/documentation.html) | |||
* `anyOf`, `allOf`, and `oneOf`, or multiple `types` (i.e. `"type": ["string", "array"]` | |||
Nobody yet has come up with a PR that adds this feature with a simple and easy-to-understand UX. | |||
You can use `oneOf` with [schema dependencies](#schema-dependencies) to dynamically add schema properties based on input data but this feature does not bring general support for `oneOf` elsewhere in a schema. | |||
* `"additionalProperties":false` when used with [schema dependencies](#schema-dependencies) will not remove the extra properties and produce invalid schemas. It is recommended to avoid setting `"additionalProperties":false`. See [#848](https://github.com/mozilla-services/react-jsonschema-form/issues/848) [#902](https://github.com/mozilla-services/react-jsonschema-form/issues/902) [#992](https://github.com/mozilla-services/react-jsonschema-form/issues/992) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you change the wording here? I can't tell if this means "will not remove the extra properties and will produce invalid schemas" or "will not remove the extra properties and will not produce invalid schemas"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, can you make your change in the docs
directory instead of the README? Thanks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure thing! I'll create an fresh pull request since this one is a bit stale from your new changes.
Also FYI both @jericmason work for saasquatch.com and would be happy to help contribute regularly to this project in any way. We have 4-5 developers that spend every day building using this library.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, that's great! Let me know what kind of feature ideas / bugs you come across; I'll try to be as responsive as possible to new ideas / PRs.
Replaced with #1149 |
Relates to #848 #902 #992 (and maybe others).
Reasons for making this change
It seems like a lot of people are running into the same problem, this will help them avoid it earlier and be more clear about the current limitations of the library.
Checklist
npm run cs-format
on my branch to conform my code to prettier coding style