Skip to content
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(ibm-required-array-properties-in-response): add new validator rule #684

Merged
merged 1 commit into from
Sep 24, 2024

Conversation

padamstx
Copy link
Member

@padamstx padamstx commented Sep 24, 2024

PR summary

This commit introduces the new 'ibm-required-array-properties-in-response' validator rule, which enforces API Handbook guidance related to array properties defined within response schemas.
This rule will look for and warn about any array properties defined as optional within each response body's schema (and any sub-schemas reachable from there).

PR Checklist

General checklist

Please make sure that your PR fulfills the following requirements:

  • The commit message follows the Angular Commit Message Guidelines.
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)
  • Dependencies have been updated as needed
  • .secrets.baseline updated as needed?

Checklist for adding a new validation rule:

  • Added new validation rule definition (packages/ruleset/src/rules/*.js, index.js)
  • If necessary, added new validation rule implementation (packages/ruleset/src/functions/*.js, updated index.js)
  • Added new rule to default configuration (packages/ruleset/src/ibm-oas.js)
  • Added tests for new rule (packages/ruleset/test/*.test.js)
  • Added docs for new rule (docs/ibm-cloud-rules.md)

@padamstx padamstx self-assigned this Sep 24, 2024
Copy link
Member

@dpopp07 dpopp07 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! Left some minor, optional suggestions

This commit introduces the new 'ibm-required-array-properties-in-response'
validator rule, which enforces API Handbook guidance related to array
properties defined within response schemas.
This rule will look for and warn about any array properties defined as optional
within each response body's schema (and any sub-schemas reachable from there).

Signed-off-by: Phil Adams <phil_adams@us.ibm.com>
@padamstx padamstx merged commit 7cc4be2 into main Sep 24, 2024
4 checks passed
@padamstx padamstx deleted the new-array-rule branch September 24, 2024 18:36
ibm-devx-sdk pushed a commit that referenced this pull request Sep 24, 2024
# @ibm-cloud/openapi-ruleset-utilities [1.4.0](https://github.com/IBM/openapi-validator/compare/@ibm-cloud/openapi-ruleset-utilities@1.3.2...@ibm-cloud/openapi-ruleset-utilities@1.4.0) (2024-09-24)

### Features

* **ibm-required-array-properties-in-response:** add new validator rule ([#684](#684)) ([7cc4be2](7cc4be2))
@ibm-devx-sdk
Copy link

🎉 This PR is included in version 1.4.0 🎉

The release is available on npm package (@latest dist-tag)

Your semantic-release bot 📦🚀

ibm-devx-sdk pushed a commit that referenced this pull request Sep 24, 2024
# @ibm-cloud/openapi-ruleset [1.23.0](https://github.com/IBM/openapi-validator/compare/@ibm-cloud/openapi-ruleset@1.22.0...@ibm-cloud/openapi-ruleset@1.23.0) (2024-09-24)

### Features

* **ibm-required-array-properties-in-response:** add new validator rule ([#684](#684)) ([7cc4be2](7cc4be2))

### Dependencies

* **@ibm-cloud/openapi-ruleset-utilities:** upgraded to 1.4.0
@ibm-devx-sdk
Copy link

🎉 This PR is included in version 1.23.0 🎉

The release is available on npm package (@latest dist-tag)

Your semantic-release bot 📦🚀

ibm-devx-sdk pushed a commit that referenced this pull request Sep 24, 2024
# ibm-openapi-validator [1.24.0](https://github.com/IBM/openapi-validator/compare/ibm-openapi-validator@1.23.0...ibm-openapi-validator@1.24.0) (2024-09-24)

### Features

* **ibm-required-array-properties-in-response:** add new validator rule ([#684](#684)) ([7cc4be2](7cc4be2))

### Dependencies

* **@ibm-cloud/openapi-ruleset:** upgraded to 1.23.0
@ibm-devx-sdk
Copy link

🎉 This PR is included in version 1.24.0 🎉

The release is available on npm package (@latest dist-tag)

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants