Skip to content
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

Build and maintain an official JSON schema for pubspec.yaml #4389

Open
jonasfj opened this issue Sep 12, 2024 · 0 comments
Open

Build and maintain an official JSON schema for pubspec.yaml #4389

jonasfj opened this issue Sep 12, 2024 · 0 comments
Labels
good first issue A good starting issue for contributors (issues with this label will appear in /contribute)

Comments

@jonasfj
Copy link
Member

jonasfj commented Sep 12, 2024

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 uses oneOf instead of using anyOf.

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.

@jonasfj jonasfj added the good first issue A good starting issue for contributors (issues with this label will appear in /contribute) label Sep 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue A good starting issue for contributors (issues with this label will appear in /contribute)
Projects
None yet
Development

No branches or pull requests

1 participant