Skip to content

Conversation

@Karan-Palan
Copy link
Contributor

Description

This PR addresses the following linting issues in the expo-37.0.0.json schema:

  • Replaced type alongside enum to adhere to JSON Schema best practices.
  • Prefixed unknown keywords with x- to ensure compatibility with future versions of JSON Schema.
  • Removed redundant additionalProperties and properties declarations that added no further constraints.
  • Simplified type declarations that used arrays with a single type.

These changes were made to ensure compliance with JSON Schema standards and to resolve the reported linting errors. The schema was updated using the jsonschema lint --fix command

Screenshots

Before and after:

image

Note

I, along with Juan (JSON Schema TSC member) are defining linting rules for JSON Schema as a Part of a GSoC (Google Summer of code) project here - https://github.com/Karan-Palan/JSON-Schema-Linting, and implementing their auto-fixes here - https://github.com/sourcemeta/jsonschema/blob/main/docs/lint.markdown. We have recently added many rules prefixing unknown keywords with x- which will be introduced in the newer JSON Schema drafts
If beneficial to the project, I suggest integrating the linter with it to write the best schemas and catch any errors and follow best practices. Example of an integration - https://github.com/krakend/krakend-schema/blob/main/.github/workflows/validate-json-schema.yml#L10

@github-actions
Copy link
Contributor

Thanks for the PR!

This section of the codebase is owned by @madskristensen and @hyperupcall - if they write a comment saying "LGTM" then it will be merged.

@Karan-Palan
Copy link
Contributor Author

The validation fails because AJV ran in strict mode and isn't fully compliant with JSON Schemas, ref - https://youtu.be/wJ7bK22n3IU?si=IOaTDkIGaP5EZ4HY&t=542

@hyperupcall
Copy link
Member

I'm a bit hesitant to merge these - I think the schema is autogenerated so I think it would be better to fix any problems at the source. Also I'm not sure if adding x- to some properties will break things on Expo's side

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants