Skip to content

STOP-4939 : Added severity for path-declarations-must-exist rule in ruleset package#2907

Open
SB-ChetanKorde wants to merge 13 commits intodevelopfrom
gha-STOP-4939-OASRules
Open

STOP-4939 : Added severity for path-declarations-must-exist rule in ruleset package#2907
SB-ChetanKorde wants to merge 13 commits intodevelopfrom
gha-STOP-4939-OASRules

Conversation

@SB-ChetanKorde
Copy link
Copy Markdown

@SB-ChetanKorde SB-ChetanKorde commented Mar 5, 2026

Fixes #STOP-4939.

Description
The path-declarations-must-exist rule in the OAS ruleset (located at line 332 in index.ts) was incorrectly reporting violations as warnings instead of errors.

Original Behavior
warning  path-declarations-must-exist  Path parameter declarations must not be empty
This severity level was inconsistent with the rule's intent, which should prevent invalid empty path parameters like /users/{} from being deployed.

Fix Applied
Updated the path-declarations-must-exist rule severity from 0 (hint) to 2 (error) in index.ts:332:
'path-declarations-must-exist': { message: 'Path parameter declarations must not be empty, ex."/given/{}" is invalid.', recommended: true, given: '$.paths', severity: 2, // Changed from: severity: 0 then: { field: '@key', function: pattern, functionOptions: { notMatch: '{}', }, }, },

Checklist/Validation

  • Build all packages
    cd /Users/chetannkorde/Documents/Code-Area-51/Spectral-Repo
    yarn build

  • Reinstall spectral-cli globally
    npm uninstall -g @stoplight/spectral-cli
    npm install -g packages/cli --no-save --force

Does this PR introduce a breaking change?

  • Yes
  • No

Screenshots

@SB-ChetanKorde SB-ChetanKorde requested a review from a team as a code owner March 5, 2026 07:35
@SB-ChetanKorde SB-ChetanKorde requested review from bhaskarsontakke and prafullaAtSB and removed request for SB-dineshbabhale March 6, 2026 10:41
update test case for - path-declarations-must-exist where it was looking for warning but recent change make it error
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.

4 participants