Dumb idea / question - Type/Schema/Contract Definition for JSON5 Files #53
Unanswered
tomkennedy22
asked this question in
Q&A
Replies: 1 comment
-
Thanks for your question. I've converted this to a GitHub discussion. The problem you're presenting has already been solved in JSON documents by using JSON Schema, and you can add a I'm not sure if there are any libraries that validation JSON5 against a schema, but you could always convert the JSON5 document to JSON and then validate it against a schema. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi all, I'm a JSON5 user and big fan. I'm encountering a small problem - not with JSON5 itself, but with maintaining some datasets in JSON5.
I pull data into Typescript and hope that the underlying datasets have the right structure. I, as the maintainer of my project, can verify the underlying JSON5 files have the right structure. But as I have more contributors, I worry that they might not structure it correctly, and run into problems in the code.
So, I'm just brainstorming, spitballing, etc. I understand my question is far outside the scope of normal JSON5 operations. But does anyone have thoughts/feelings on the ability to define a structure of your data, and have it linted & enforced directly in the JSON file, rather than on data read?
So like my file could look like this, with
structure
defining types, anddata
defining dataAnd maybe even other metadata fields as well.
Beta Was this translation helpful? Give feedback.
All reactions