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

Replace json-schema gem with json_schemer gem #108

Open
nickthecook opened this issue Oct 15, 2024 · 0 comments
Open

Replace json-schema gem with json_schemer gem #108

nickthecook opened this issue Oct 15, 2024 · 0 comments
Labels

Comments

@nickthecook
Copy link
Owner

The json-schema gem doesn't seem to support any recent versions of the JSON Schema spec, and this causes some issues in testing:

  • adding a definition for any property to an object makes that property required - I can't make this thing accept that a defined property is optional
  • if a property is defined, it seems to be required in the required list - I can't add a property and not make it required

I've used JSON Schemer in another app, and it behaves according to the most recent JSON Schema spec.

If optional properties were supported, it would reduce duplication in the schema files. For example, index typically returns a list of objects that also match the response from show, except some fields will be excluded in index. If there were a schema for, e.g., document in which the attributes that index doesn't return were optional, the schema for documents could reference it instead of duplicating it and having some properties removed.

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

No branches or pull requests

1 participant