-
Notifications
You must be signed in to change notification settings - Fork 87
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
Create JSON Schema to further define and constrain the spec. #10
Comments
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. |
Interesting idea! Couple of questions:
|
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 |
one proposed solution for obsidianmd#10
…erfaces. Define properties and types for nodes and edges. Include descriptions for clarity. Create TypeScript interfaces for JsonCanvas, CanvasNode, TextNode, FileNode, LinkNode, GroupNode, AllNodes, and Edge with detailed attributes and types. alternative proposal for obsidianmd#10
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
The text was updated successfully, but these errors were encountered: