-
Notifications
You must be signed in to change notification settings - Fork 85
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
feat: custom Spectral rule to ensure content objects contain schema #258
Conversation
ecb9d94
to
48a17c1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This does seem to satisfy the requirement but I think it can be simplified while still achieving the same result.
src/spectral/rulesets/custom-rules/content-entry-contains-schema.yaml
Outdated
Show resolved
Hide resolved
src/spectral/rulesets/custom-rules/content-entry-contains-schema.yaml
Outdated
Show resolved
Hide resolved
src/spectral/rulesets/custom-rules/content-entry-contains-schema.yaml
Outdated
Show resolved
Hide resolved
57ea363
to
1943653
Compare
3bc8236
to
36ad0f4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this looks good but I did have one question about the Spectral implementation to check on before merging (might want to wait for other reviews as well)
73453b8
to
0b09c2a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code here looks good but another key part of creating our own custom rules is documenting them. We probably need to add a new section to the README that describes each custom rule, like the docs/reference/openapi-rules.md
in Spectral.
0b09c2a
to
0e94bf3
Compare
To keep the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Almost done, but we need to document this from the point of view of the user.
0e94bf3
to
8167eef
Compare
Purpose: - Establish a pattern in the validator for adding custom spectral rules and custom spectral functions - Ensure content objects contain a schema Changes: - Add custom spectral rule to ensure that content objects contain a schema (defaults to warning) Tests: - Add tests for each use case outlined in the spectral rule Docs: - Add a central location for documenting custom Spectral rules - Document the `content-entry-contains-schema` rule
8167eef
to
41767c8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. 👍
# [0.37.0](v0.36.0...v0.37.0) (2021-03-16) ### Features * custom Spectral rule to ensure content objects contain schema ([#258](#258)) ([bb9e419](bb9e419))
🎉 This PR is included in version 0.37.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Purpose:
Changes:
Tests: