Build and maintain an official JSON schema for pubspec.yaml
#4389
Labels
good first issue
A good starting issue for contributors (issues with this label will appear in /contribute)
There is a JSON schema here:
https://github.com/SchemaStore/schemastore/blob/master/src/schemas/json/pubspec.json
However, it has some bugs, for example on
publish_to: none
, because it usesoneOf
instead of usinganyOf
.I think we should fix that. Moreover, I think we should declare and maintain an official JSON schema in this repository.
Possible, we should also have test cases and such.
We can settle with only running test cases in CI, using ajv (npm + node.js). I'm thinking we'd benefit from writing the schema in YAML, and would need to export it as JSON for others.
We could also work to become code owners in SchemaStore (if they'll have us 🤣).
We could also use JSON schema to generate: https://dart.dev/tools/pub/pubspec
This is just a possibly crazy idea. There are also tools like docson to render JSON schemas as documentation. Something worth considering, hopefully there are newer and better tools too.
This could be a good contribution opportunity.
Full disclosure: I haven't thought all of this through. Could be reasons we don't want to do this.
The text was updated successfully, but these errors were encountered: