Skip to content
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

JSON Schema - use of allOf, oneOf #8

Open
JYone3A opened this issue Jun 24, 2021 · 0 comments
Open

JSON Schema - use of allOf, oneOf #8

JYone3A opened this issue Jun 24, 2021 · 0 comments

Comments

@JYone3A
Copy link

JYone3A commented Jun 24, 2021

I'm thinking about using Cambria in a tool that already uses JSON Schema (CRUD tool for JSONs). However, things like allOf and oneOf are not supported (and will not be supported as they make things too complicated, in the code but also from the perspective of the created data structures).

I was wondering why those two things are used in the Cambria JSON schema.

allOf

If I understand correctly, this is used to first import the $ref and then set a custom title/description? Couldn't the title/description then just be set on the original $refd definition? Or will this probably be used in other places as well?

Also - and again I'm not sure - can't $ref be used to import parts of another schema? So instead of re-defining the basic JSON schema types, could the $ref not point directly to http://json-schema.org/draft-07/schema/definitions/simpleTypes? Although allOf would then definitely have to be used to set the title/description ...

oneOf

Instead of the oneOf in lensOp, couldn't just one big object be created with all the ops as keys? It would allow to add multiple, but distinct OPs in one step - but is that a problem? (not sure if some of the JSON schema validation rules could be used to prevent that, we're also not making use of those)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant