question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

JSON Schema alternative

See original GitHub issue

Hi, 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:closed
  • Created 4 years ago
  • Comments:12 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
mkistlercommented, Nov 3, 2019

@chriskapp I am so happy to see this and will be very happy to help / support however I can.

1reaction
chriskappcommented, Nov 2, 2019

@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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

TypeSchema an alternative to JsonSchema
TypeSchema is a code generator friendly alternative to JsonSchema. You may be thinking, why do we need an alternative to JsonSchema, let me...
Read more >
JSON Schema vs. OpenAPI - codeburst
JSON Schema and OpenAPI can seem similar but have different use-cases. To begin, how JSON Scheme and OPenAPI differ? Well, in contrast to...
Read more >
Implementations - JSON Schema
json -schema-ref-parser (MIT) Tools for dereferencing non-cyclic schemas, bundling referenced schemas into a single file, and other $ref processing. json-schema- ...
Read more >
Awesome JSON Schema Awesome - GitHub
A curated list of awesome JSON Schema resources, tutorials, tools, and more. JSON Schema is a JSON-based format to annotate and validate JSON...
Read more >
Is JSON Schema dead? : r/javascript - Reddit
The JSON schema is essentially just metadata describing your object. Going beyond validation, you can have your JSON schemas generated from a ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found