Document a gotcha with additionalProperties#1018
Document a gotcha with additionalProperties#1018loganvolkers wants to merge 1 commit intorjsf-team:masterfrom loganvolkers:patch-2
additionalProperties#1018Conversation
|
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. |
glasserc
left a comment
There was a problem hiding this comment.
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.
| * `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.
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.
Also, can you make your change in the docs directory instead of the README? Thanks
There was a problem hiding this comment.
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.
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-formaton my branch to conform my code to prettier coding style