Skip to content

Conversation

@shakrav2
Copy link
Contributor

Closes #51

Implements lint rules for AEP-143 (Standardized Codes) to validate standardized code field naming and types in OpenAPI specifications.

Rules Implemented

  • aep-143-standardized-codes: Validates standardized code field names
  • aep-143-standardized-codes-string-type: Ensures standardized code fields use type `string`

Reference

Testing

  • Added comprehensive test coverage in `test/0143/`
  • All tests pass (18 new tests for AEP-143)
  • Code coverage: >90%
  • Linter passes

Documentation

  • Added rule documentation in `docs/0143.md`
  • Updated `docs/rules.md` index

@mkistler mkistler requested a review from Copilot October 28, 2025 03:28
Copy link

Copilot AI left a 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-codes for field naming validation and aep-143-standardized-codes-string-type for 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.

Copy link
Contributor

@mkistler mkistler left a 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.

Copy link
Contributor

@mkistler mkistler left a 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.

Copy link
Contributor

@mkistler mkistler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! 👍

@mkistler mkistler merged commit e75b075 into aep-dev:main Oct 31, 2025
3 checks passed
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.

Implement rules for AEP-143: Standardized codes

2 participants