Skip to content

fix(ibm-integer-attributes): add validation for type integer ranges - #756

Merged
diatrcz merged 7 commits into
mainfrom
validate-integer-range
Aug 4, 2025
Merged

fix(ibm-integer-attributes): add validation for type integer ranges#756
diatrcz merged 7 commits into
mainfrom
validate-integer-range

Conversation

@diatrcz

@diatrcz diatrcz commented Jul 24, 2025

Copy link
Copy Markdown
Contributor

PR summary

Adds validation for integers to check if maximum and minimum attributes are within safe ranges.
The minimum and maximum range checks are set according to the api handbook.

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 has been updated as needed
  • npm run update-utilities has been run if any files in packages/utilities/src have been updated

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)
  • Added scoring rubric entry for new rule (packages/validator/src/scoring-tool/rubric.js)

Signed-off-by: Lídia Tarcza <100163235+diatrcz@users.noreply.github.com>
@diatrcz

diatrcz commented Jul 24, 2025

Copy link
Copy Markdown
Contributor Author

I'm not sure the tests are enough to cover the implemented behaviour or if they are written in the right way to test this kind of behaviour. Feedback is appreciated!

Signed-off-by: Lídia Tarcza <100163235+diatrcz@users.noreply.github.com>
@diatrcz
diatrcz requested review from hudlow and pyrooka July 24, 2025 08:58
@CLAassistant

CLAassistant commented Jul 24, 2025

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@diatrcz diatrcz changed the title fix(integer-attributes): add validation for type integer ranges fix(ibm-integer-attributes): add validation for type integer ranges Jul 24, 2025
diatrcz added 3 commits July 28, 2025 11:22
Signed-off-by: Lídia Tarcza <100163235+diatrcz@users.noreply.github.com>
Signed-off-by: Lídia Tarcza <100163235+diatrcz@users.noreply.github.com>
Signed-off-by: Lídia Tarcza <100163235+diatrcz@users.noreply.github.com>
Comment thread packages/ruleset/src/functions/integer-attributes.js Outdated
Comment on lines +92 to +96
errors.push({
message: `'minimum' value is out of safe range`,
path,
});
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We might not want to gate this on maximum also being defined (and corresponding feedback for the three below).

diatrcz and others added 2 commits August 4, 2025 10:43
Co-authored-by: Dan Hudlow <dhudlow@us.ibm.com>
Signed-off-by: Lídia Tarcza <100163235+diatrcz@users.noreply.github.com>

@pyrooka pyrooka left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good!

@diatrcz
diatrcz merged commit 3d5f9f4 into main Aug 4, 2025
7 checks passed
@diatrcz
diatrcz deleted the validate-integer-range branch August 4, 2025 10:40
ibm-devx-sdk pushed a commit that referenced this pull request Aug 4, 2025
## @ibm-cloud/openapi-ruleset [1.31.2](https://github.com/IBM/openapi-validator/compare/@ibm-cloud/openapi-ruleset@1.31.1...@ibm-cloud/openapi-ruleset@1.31.2) (2025-08-04)

### Bug Fixes

* **ibm-integer-attributes:** add validation for type integer ranges ([#756](#756)) ([3d5f9f4](3d5f9f4))
@ibm-devx-sdk

Copy link
Copy Markdown

🎉 This PR is included in version 1.31.2 🎉

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 Aug 4, 2025
## ibm-openapi-validator [1.35.3](https://github.com/IBM/openapi-validator/compare/ibm-openapi-validator@1.35.2...ibm-openapi-validator@1.35.3) (2025-08-04)

### Bug Fixes

* **ibm-integer-attributes:** add validation for type integer ranges ([#756](#756)) ([3d5f9f4](3d5f9f4))

### Dependencies

* **@ibm-cloud/openapi-ruleset:** upgraded to 1.31.2
@ibm-devx-sdk

Copy link
Copy Markdown

🎉 This PR is included in version 1.35.3 🎉

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

Your semantic-release bot 📦🚀

@ibm-devx-sdk

Copy link
Copy Markdown

🎉 This PR is included in version 1.9.1 🎉

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.

5 participants