JSON Schema alternative
See original GitHub issueHi, so the OpenAPI spec is used in many cases to generate code and the JsonSchema spec is primarily used for validation and not for code generation. It is not suited for code generation since the schema can only be interpreted alongside the actual data and not on its own, also they have many validation keywords like if / then / else
which from my point of view dont make sense for the OpenAPI spec.
I have discovered today https://tools.ietf.org/html/draft-json-schema-language-02 and for some time I have also wrote a “strict” JSON Schema version https://github.com/chriskapp/type-json-schema for code generation. Since Iam not involved in the OpenAPI process I would like to know whether people in general are thinking about switching to a different schema spec, which does not have such problems?
Issue Analytics
- State:
- Created 4 years ago
- Comments:12 (10 by maintainers)
Top GitHub Comments
@chriskapp I am so happy to see this and will be very happy to help / support however I can.
@handrews I have just started to continue my work on a new strict JSON Schema called TypeSchema which is specifically designed for the code generation use case. If you like you can take a look at it here: https://chriskapp.github.io/typeschema/
I will close this issue and come up with a more formal proposal either directly to the OpenAPI community or to the JSON Schema community as vocabulary (if this is possible) once the work is more complete. If others from the OpenAPI community are interested @mkistler @darrelmiller @tedepstein @philsturgeon please let me know.