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

fix: ingore violations from invalid locations of an api definition #716

Closed
wants to merge 1 commit into from

Conversation

dpopp07
Copy link
Member

@dpopp07 dpopp07 commented Jan 23, 2025

PR summary

Some extensions in an API definition, like those providing SDK-related metadata, are not valid places to check for rule violations.

Since some built-in, Spectral rules use broad JSON paths for their rules, it is possible for them to report false positives within extension objects, even when the extension objects contain information that is completely unrelated to the rule (like the typed-enum rule).

To avoid this in a generic way, this change filters out any rule violations that occur within our internal, SDK-related metadata extension and provides for any potential locations that may be added in the future.

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 generate-utilities-docs has been run if any files in packages/utilities/src have been updated

Some extensions in an API definition, like those providing SDK-related metadata,
are not valid places to check for rule violations.

Since some built-in, Spectral rules use broad JSON paths for their rules, it is
possible for them to report false positives within extension objects, even when
the extension objects contain information that is completely unrelated to the
rule (like the typed-enum rule).

To avoid this in a generic way, this change filters out any rule violations that
occur within our internal, SDK-related metadata extension and provides for any
potential locations that may be added in the future.

Signed-off-by: Dustin Popp <[email protected]>
@dpopp07 dpopp07 requested a review from padamstx January 23, 2025 21:13
@dpopp07
Copy link
Member Author

dpopp07 commented Jan 27, 2025

We may want to do something like this at some point, but right now the only rule tripped up by the metadata is Spectral's typed-enum rule, which we can patch.

Closing this in favor of #719

@dpopp07 dpopp07 closed this Jan 27, 2025
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.

1 participant