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

GSoC 2025: Comprehensive JSON Schema linting for encouraging best practices and catching anti-patterns early #856

Open
jviotti opened this issue Jan 15, 2025 · 7 comments
Labels
gsoc Google Summer of Code Project Idea

Comments

@jviotti
Copy link
Member

jviotti commented Jan 15, 2025

Brief Description

Writing well-crafted schemas is extremely hard. Not only JSON Schema is a complex schema language and it is easy to shoot yourself in the foot, but as an organisation, we never properly encoded and shared what the best practices and anti-patterns are. As a consequence, our users (including users of API specifications like OpenAPI and AsyncAPI) don't know how to write great schemas, and don't even know what the quality of the schemas they already have is.

I kickstarted some of this work on my open-source tooling (https://github.com/sourcemeta/jsonschema/blob/main/docs/lint.markdown) and would like to take it to the next level.

Expected Outcomes

  • Reach agreement on what the anti-patterns and best practices are across dialects, documenting these in the official JSON Schema organisation as a style guide / advice document in the JSON Schema website. In there, we can publish each rule with a stable URL so any linter out there can link to them when reporting failures, etc saving all of us time from actually explaining them in each tool 😅
  • Extend popular open-source tooling made by TSC members and endorsed by the org (like the Sourcemeta JSON Schema CLI, but potentially others too) to encode the before-mentioned anti-patterns and best practices in a runnable form

Skills Required

  • Strong communication skills, as the first point might involve talking to lots of people in the community and driving discussions to reach agreement.
  • A good understanding of JSON Schema, enough to appreciate and understand what the discovered anti-patterns and best practices would be. Of course, we will mentor a lot in this area
  • A good understanding of the programming language(s) used in the endorsed open-source linting tooling we will extend. The Sourcemeta JSON Schema CLI is written in C++ (it also has a library form that could be then used by other projects)

Mentors

Expected Difficulty

Medium.

Expected Time Commitment

350 hours. We expect most of the time being spent driving discussions to reach agreement. Doing so often takes a lot of time!

@jviotti jviotti added the gsoc Google Summer of Code Project Idea label Jan 15, 2025
@Honyii
Copy link
Contributor

Honyii commented Jan 15, 2025

Great idea Juan, thanks for your submission.

@benjagm
Copy link
Collaborator

benjagm commented Jan 18, 2025

Hi Juan, have you seen the work done by @gregsdennis here:

https://github.com/json-schema-org/json-schema-linting

@jviotti
Copy link
Member Author

jviotti commented Jan 20, 2025

Ah, very nice @benjagm. We should definitely take that as inspiration. Cool stuff. @gregsdennis Is it something you are actively working on?

@gregsdennis
Copy link
Member

gregsdennis commented Jan 20, 2025

No. I started some Spectral stuff a year or so ago, but never got beyond a start. Feel free to overwrite what I've done.

@Relequestual
Copy link
Member

Adding myself as a mentor as discussed with @jviotti =]

@cbum-dev
Copy link

Hi @jviotti and @Relequestual
I’ve been learning JSON Schema from the official docs for the past few weeks and now have a good understanding of it.I’ve also explored various linting methods, including the Sourcemeta JSON Schema Linting Guide and Json Schema Linting, to understand existing approaches.
I’m interested in contributing to this issue for GSoC 2025 if this project gets selected under the guidance of you.
To align with the project's needs, I'd love to get involved in community discussions on various linting methods and best practices. I'm also open to guidance on the most critical anti-patterns to focus on. Looking forward to your thoughts🙂.

@karenetheridge
Copy link
Member

Please also see the prior work at

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
gsoc Google Summer of Code Project Idea
Projects
None yet
Development

No branches or pull requests

7 participants