Open mwadams opened 6 months ago
This is a duplicate.
You can see my attempt made yesterday. Already done an MR. Maybe there is a few things to tweak like adding description though.
I think we can either work from yours or mine.
The interesting thing about this approach with the documentation in the schema like this is that we could generate the human-readable text from the schema.
I've been diving deep into JSON Schema and OpenAPI specs recently. I think building the JSON Schema from TypeScript source is good for maintainability. If there is an appetite for it I can transform this JSON to TS and set up the pipeline for programmatically generating the JSON Schema? also relates to https://github.com/obsidianmd/jsoncanvas/issues/4
I've been diving deep into JSON Schema and OpenAPI specs recently. I think building the JSON Schema from TypeScript source is good for maintainability. If there is an appetite for it I can transform this JSON to TS and set up the pipeline for programmatically generating the JSON Schema? also relates to #4
Interesting idea!
Couple of questions:
draft2020-12
(which is the current JSON Schema draft)I've experimented with pretty much every tool I can find. So it's dealer's choice. I've found Draft-07 to be a lot more widely supported still, but I have enough reliable tooling to support 2020-12. What are @kepano and @ericaxu's thoughts?
Over in json-schema land we are warmly encouraging people to adopt 2020-12. Most draft7 specs translate trivially and you will be well positioned for vNext. There is now plenty of high quality tooling for most languages.
@mwadams for me the one downside is (as of writing) lack of support in VSCode for 2020-12
I would suggest creating a JSON Schema to define the spec.
Here's a first pass at that.
From this we can generate object models to validate and operate over the files in a variety of different languages.
For example, I attach code generated by
Corvus.JsonSchema
to work with the object model in C#/dotnet.Corvus.JsonSchema.Generated.zip