Skip to content

chore: add no-sub-resources lint rule - #33

Merged
vadyvas merged 2 commits into
mainfrom
chore/no-sub-resources-rule
Nov 19, 2026
Merged

vadyvas merged 2 commits into
mainfrom
chore/no-sub-resources-rule

Conversation

@vadyvas

@vadyvas vadyvas commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

What

Adds rule/no-sub-resources to redocly.yaml, based on Avoid sub-resources.

rule/no-sub-resources:
  subject:
    type: Paths
  assertions:
    notPattern: /^(?!\/(oauth2|\.well-known)\/)(.*\/){3}/
  message: Avoid sub-resources.

How it differs from the blog snippet

  • /oauth2/ and /.well-known/ are excluded: their paths are fixed by RFC 7592 and RFC 8414. Without this, /oauth2/register/{clientId} fails lint.

Verification (Redocly CLI 2.81.0)

  • Reports: /customers/{customerId}/subscriptions, /a/b/c/d, /x/oauth2/y
  • Silent: /subscriptions/{subscriptionId}, /oauth2/register/{clientId}, /.well-known/oauth-authorization-server/tenant, a callback key with 3 slashes, a webhook named a/b/c/d
  • redocly lint on the Cafe API passes.

Flag path keys with three or more slashes, following
https://redocly.com/blog/no-subresources. Protocol-defined paths under
/oauth2/ and /.well-known/ are excluded.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@redocly redocly Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

cafe

AI Review: 🟢 Completed

Note

Low Risk

Introduces a lint rule in redocly.yaml without altering published documentation content or runtime behavior. Blast radius is strictly limited to Redocly linting workflows.

Overview

Adds the rule/no-sub-resources assertion to redocly.yaml to flag OpenAPI paths containing three or more slashes, encouraging top-level resource design. Specific RFC-standardized path prefixes (/oauth2/ and /.well-known/) are excluded to accommodate fixed path patterns.

Changed pages

⚙️ Configuration or theme changed

Open preview

@vadyvas vadyvas self-assigned this Nov 19, 2026
@vadyvas
vadyvas requested a review from a team November 19, 2026 15:29
@vadyvas
vadyvas marked this pull request as ready for review November 19, 2026 15:31
Comment thread redocly.yaml Resolved
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@vadyvas
vadyvas merged commit c408ec2 into main Nov 19, 2026
5 of 7 checks passed
@vadyvas
vadyvas deleted the chore/no-sub-resources-rule branch November 19, 2026 16:30
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