-
Notifications
You must be signed in to change notification settings - Fork 3
Add rules for aep-143 with docs and tests #56
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
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.
Pull Request Overview
This PR implements linting rules for AEP-143 (Standardized Codes) to enforce consistent naming conventions and types for common standardized code fields in OpenAPI specifications. The implementation validates that fields like language codes, region codes, and currency codes use standardized names (e.g., language_code instead of lang) and ensures they are typed as strings.
Key Changes:
- Added two new lint rules:
aep-143-standardized-codesfor field naming validation andaep-143-standardized-codes-string-typefor type validation - Implemented custom validation functions to check schema properties against AEP-143 standards
- Added comprehensive test coverage (18 tests) and documentation
Reviewed Changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
test/0143/standardized-codes.test.js |
Tests validation of standardized field names (lang→language_code, country→region_code, etc.) |
test/0143/standardized-codes-string-type.test.js |
Tests that standardized code fields require string type |
spectral.yaml |
Registers new AEP-143 rule set and custom validation functions |
functions/standardized-codes.js |
Validates field names match AEP-143 conventions |
functions/standardized-codes-string-type.js |
Validates standardized code fields use string type |
docs/rules.md |
Updates rule index with AEP-143 and other AEP references |
docs/0143.md |
Comprehensive documentation for AEP-143 rules with examples |
aep/0143.yaml |
Spectral rule configuration for AEP-143 validation |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
mkistler
left a comment
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 looks good but we should avoid using a custom function when it isn't required.
mkistler
left a comment
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.
Would like to avoid the custom function if possible.
4a254e6 to
45275ed
Compare
mkistler
left a comment
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! 👍
Closes #51
Implements lint rules for AEP-143 (Standardized Codes) to validate standardized code field naming and types in OpenAPI specifications.
Rules Implemented
Reference
Testing
Documentation