Skip to content

fix: narrow tags-should-be-in-sentence-case Spectral rule to avoid false positives#1635

Open
PedroAntunesCosta wants to merge 1 commit intomasterfrom
fix/spectral-tags-rule-false-positives
Open

fix: narrow tags-should-be-in-sentence-case Spectral rule to avoid false positives#1635
PedroAntunesCosta wants to merge 1 commit intomasterfrom
fix/spectral-tags-rule-false-positives

Conversation

@PedroAntunesCosta
Copy link
Copy Markdown
Contributor

@PedroAntunesCosta PedroAntunesCosta commented Apr 7, 2026

Fixes false positives in the tags-should-be-in-sentence-case Spectral rule that were triggered by response body schema properties named tags.

Changes

  • Replaced the broad recursive JSONPath $..tags[*] with two specific paths:
    • $.tags[*].name — targets root-level OpenAPI tag definitions
    • $.paths.*.*.tags[*] — targets operation-level tag references
  • This prevents the rule from matching schema properties named tags in response bodies

Why

The recursive descent operator ($..) matched ANY property named tags anywhere in the document, including response body schema properties that describe an API's tags field. This caused false positive errors during portal builds (e.g., in the Custom Fields API schema).

@PedroAntunesCosta PedroAntunesCosta added the bug Something isn't working label Apr 7, 2026
@PedroAntunesCosta PedroAntunesCosta self-assigned this Apr 7, 2026
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 7, 2026

Thanks for your contribution. The .json file will be checked now with Spectral.

Copy link
Copy Markdown
Contributor

@Isabella-Veloso Isabella-Veloso left a comment

Choose a reason for hiding this comment

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

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants