-
Notifications
You must be signed in to change notification settings - Fork 39
fix(schema): schema linting issues autofix #46
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
Conversation
|
Hi Karan. Thank you so much for your contribution to our repository. We truly appreciate the time and effort you've dedicated to improving it. We've reviewed the pull request, and it looks like there might be some spacing format changes that are causing all lines to appear as modified in the diff. Would it be possible for you to adjust the formatting so that the diff only reflects the actual changes you've made? This would greatly help us in reviewing and merging your valuable contribution. Thank you again for your understanding and for your efforts. |
See: getmanfred/mac#46 Signed-off-by: Juan Cruz Viotti <[email protected]>
See: getmanfred/mac#46 Signed-off-by: Juan Cruz Viotti <[email protected]>
|
Hi @recacha @Karan-Palan , Great feedback on the formatting! I just released v11.8.0 (https://github.com/sourcemeta/jsonschema/releases/tag/v11.8.0) which implements an @Karan-Palan Also, I think some of the diff is because you are also running |
|
@jviotti, thank you for the quick updates! That makes the diff much nicer. I'm updating the PR now. Also, @recacha, the |
Signed-off-by: karan-palan <[email protected]>
8ca2f43 to
f5a1075
Compare
|
Hi @Karan-Palan and @jviotti I really appreciate your contributions and the excellent work! Regarding the indentation correction, I would be very grateful if, as Juan mentioned, this could be added in a new pull request :-) Thank you once again!! |
🧐 Context
Removed Anti-Patterns:
typealongsideenumas the enumeration choices already imply their respective types.typealongsideconstas the constant already implies its respective type.Resolved Redundant Keywords:
additionalItemswhereitemsis set to a schema, as it is ignored in such cases.minContainswherecontainsis not present, as it is meaningless withoutcontains.Optimized Schema Structure:
allOfwrappers to improve evaluationPlease review the changes and provide feedback if necessary.
🤙 How to test
jsonschema lintafter the fixes to ensure no further issues were reported.Before:
After:
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 draftsIf beneficial to the project, I suggest integrating the complete cli with it to write the best schemas and catch any errors and follow best practices. Examples of integration - https://github.com/krakend/krakend-schema/blob/main/.github/workflows/validate-json-schema.yml#L10, daveshanley/vacuum#701