Skip to content

Conversation

@myprivatealaska
Copy link
Contributor

Hi team, we use optic for breaking change detection, and it’s been very effective. However, exclude_operations_with_extension doesn’t fully support excluding unstable API endpoints for our use case. We extended its functionality in our fork and believe this enhancement could benefit other users, so we’d like to contribute it upstream.

We have a custom x-stability-level extension that supports the following string values draft, alpha, beta. We wanted to be able to configure what values indicate that the endpoint should be excluded from the breaking changes check, for example:

ruleset:
  - 'breaking-changes':
      exclude_operations_with_extension:
        - 'x-stability-level':
            - 'draft'
            - 'alpha'
            - 'beta'

🍗 Description

This PR introduces enhanced logic to the excludeOperationWithExtensionMatches utility in projects/standard-rulesets/src/utils.ts. The function now supports excluding operations based on specific extension values, while previously it could only operate on "truthy" values.
Extension exclusion logic now explicitly handles single extension strings, arrays of extension strings, and arrays of objects specifying extension keys and allowed values.

Copy link
Member

@acunniffe acunniffe 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 great and is a great (non-breaking) improvement! Thanks for the contribution. Running a few tests locally and will get this merged soon

@acunniffe acunniffe merged commit 0b5442e into opticdev:main Aug 10, 2025
0 of 3 checks passed
@acunniffe
Copy link
Member

It's out @myprivatealaska https://github.com/opticdev/optic/releases/tag/v1.0.9

Thanks for the contribution!!

@myprivatealaska
Copy link
Contributor Author

It's out @myprivatealaska https://github.com/opticdev/optic/releases/tag/v1.0.9

Thanks for the contribution!!

Thank you for a quick review! I'm happy you find this enhancement valuable!

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.

2 participants