Add preliminary support for the anyOf keyword#1118
Add preliminary support for the anyOf keyword#1118glasserc merged 6 commits intorjsf-team:masterfrom LucianBuzzo:anyof-support
Conversation
|
Note that the unit tests are failing due to the New year rollover, which I've fixed/band-aided in a separate PR here #1119 |
|
This looks good to me as a change and would be extremely useful if merged. Thanks ! :) |
|
@edi9999 Could you review this PR please? |
This change introduces support for the `anyOf` keyword. The keyword is NOT supported in arrays (using the `items` keyword). Options provided in the `anyOf` keyword are rendered using a new component called `AnyOfField` this can be overridden with a custom field using the `fields` property. Signed-off-by: Lucian <lucian.buzzo@gmail.com>
|
@edi9999 I've addressed your review comments |
glasserc
left a comment
There was a problem hiding this comment.
I'm really excited to see this! The code mostly looks good and it's got tests, thank you very much!
Documentation would be great :) In particular, I think it's worth calling out that properties provided by anyOf should not overlap any properties from "outside" the anyOf.
|
Fantastic, thanks. I'll cut 1.2.0 in a few minutes. |
|
Is this missing from the playground? |
|
@strahius I think the playground hasn't been updated, you can see it in action if you run the playground from source. |
|
You are right, it just hasn't been deployed yet probably. Thanks a lot, good job! |
|
@strahius the playground should be updated now. |
This change introduces support for the
anyOfkeyword. Other PRs that add support foranyOf/oneOfexist, but are stale and/or incomplete ( #302, #417, #940 ).The keyword is NOT supported in arrays (using the
itemskeyword).Options provided in the
anyOfkeyword are rendered using a new component calledAnyOfField, this can be overridden with a custom field using thefieldsproperty.I'd like to follow-up on this PR with work to add support for
anyOfin arrays andoneOf. I decided against submitting that work in this PR to help keep reviews and discussion manageable.Checklist
npm run cs-formaton my branch to conform my code to prettier coding style