Skip to content

fix(ruleset): don't flag binary file-download responses as collections - #873

Merged
pyrooka merged 1 commit into
IBM:mainfrom
fadhlaouir:fix/collection-array-property-binary-response
Nov 4, 2026
Merged

pyrooka merged 1 commit into
IBM:mainfrom
fadhlaouir:fix/collection-array-property-binary-response

Conversation

@fadhlaouir

Copy link
Copy Markdown
Contributor

Closes #786

PR summary

Fixes a false positive in ibm-collection-array-property. The rule runs against every 2xx GET response content schema, so a list-type operation that returns a binary file download — e.g. a PDF served as application/pdf, whose schema is type: string, format: binary — was incorrectly required to define a collection array property and emitted a warning.

A binary response body is never a collection, so the rule now skips the check when the response schema is a binary schema. Includes a regression test covering a list operation whose response is a binary file download.

PR Checklist

General checklist

  • 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

The ibm-collection-array-property rule runs against every 2xx GET
response content schema. When a list-type operation also returns a
binary file download (for example a PDF served as application/pdf,
whose schema is `type: string, format: binary`), the rule expected
that response to define a collection array property and emitted a
false-positive warning.

A binary response body is never a collection, so skip the check when
the response schema is a binary schema. Adds a regression test.

Signed-off-by: Fadhlaoui Raed <raed.fadhlaoui@hotmail.com>
@fadhlaouir
fadhlaouir force-pushed the fix/collection-array-property-binary-response branch from 31db7d5 to b4a4d41 Compare November 4, 2026 14:26

@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!

@pyrooka
pyrooka merged commit cf5b383 into IBM:main Nov 4, 2026
9 checks passed
ibm-devx-sdk pushed a commit that referenced this pull request Nov 4, 2026
## @ibm-cloud/openapi-ruleset [1.33.17](https://github.com/IBM/openapi-validator/compare/@ibm-cloud/openapi-ruleset@1.33.16...@ibm-cloud/openapi-ruleset@1.33.17) (2026-11-04)

### Bug Fixes

* **ibm-collection-array-property:** don't flag binary file-download responses ([#873](#873)) ([cf5b383](cf5b383))
@ibm-devx-sdk

Copy link
Copy Markdown

🎉 This PR is included in version 1.33.17 🎉

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.38.8 🎉

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

Your semantic-release bot 📦🚀

@fadhlaouir
fadhlaouir deleted the fix/collection-array-property-binary-response branch November 6, 2026 14:10
@ibm-devx-sdk

Copy link
Copy Markdown

🎉 This PR is included in version 1.9.5 🎉

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.

False positive: Rule incorrectly expects array collections property for binary PDF files

3 participants