Skip to content

fix: reported error location at correct node for parameters#2626

Merged
kanoru3101 merged 13 commits intomainfrom
fix/resolve-ref-in-path
Mar 4, 2026
Merged

fix: reported error location at correct node for parameters#2626
kanoru3101 merged 13 commits intomainfrom
fix/resolve-ref-in-path

Conversation

@kanoru3101
Copy link
Contributor

@kanoru3101 kanoru3101 commented Mar 2, 2026

What/Why/How?

For parameters referenced via $ref, the error location now points at the $ref usage instead of the component definition.

Reference

#1241

Testing

openapi: 3.1.0
servers:
  - url: https://test-example.com
info:
  title: Repro issue
  version: 0.0.1
  license:
    name: MIT
    url: https://opensource.org/licenses/MIT
security: []
paths:
  /users/data:
    post:
      summary: Query user data
      operationId: queryUserData
      parameters:
        - $ref: "#/components/parameters/header_contentType"
        - $ref: "#/components/parameters/path_userId"
      responses:
        "200":
          description: OK
        "400":
          description: Bad Request

components:
  parameters:
    header_contentType:
      name: content-type
      in: header
      schema:
        type: string
    path_userId:
      name: user-id
      in: path
      required: true
      schema:
        type: string

Screenshot 2026-03-02 at 18 24 18

Screenshots (optional)

Check yourself

  • Code changed? - Tested with Redoc/Realm/Reunite (internal)
  • All new/updated code is covered by tests
  • New package installed? - Tested in different environments (browser/node)
  • Documentation update considered

Security

  • The security impact of the change has been considered
  • Code follows company security practices and guidelines

@changeset-bot
Copy link

changeset-bot bot commented Mar 2, 2026

🦋 Changeset detected

Latest commit: 289c664

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
@redocly/openapi-core Patch
@redocly/cli Patch
@redocly/respect-core Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@kanoru3101 kanoru3101 changed the title fix: resolve path where is error in path fix: reported error location at correct node for parameters Mar 2, 2026
@kanoru3101 kanoru3101 added the snapshot Create experimental release PR label Mar 2, 2026
@kanoru3101 kanoru3101 self-assigned this Mar 2, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Mar 2, 2026

📦 A new experimental 🧪 version v0.0.0-snapshot.1772460631 of Redocly CLI has been published for testing.

Install with NPM:

npm install @redocly/cli@0.0.0-snapshot.1772460631
# or
npm install @redocly/openapi-core@0.0.0-snapshot.1772460631
# or
npm install @redocly/respect-core@0.0.0-snapshot.1772460631

⚠️ Note: This is a development build and may contain unstable features.

@github-actions
Copy link
Contributor

github-actions bot commented Mar 2, 2026

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 79.15% (🎯 79%) 6381 / 8061
🔵 Statements 78.6% (🎯 78%) 6593 / 8387
🔵 Functions 82.4% (🎯 82%) 1307 / 1586
🔵 Branches 71.01% (🎯 70%) 4344 / 6117
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
packages/core/src/rules/common/path-params-defined.ts 96.55% 93.75% 92.3% 98.21% 118, 131
Generated in workflow #8911 for commit 289c664 by the Vitest Coverage Report Action

@github-actions
Copy link
Contributor

github-actions bot commented Mar 2, 2026

CLI Version Mean Time ± Std Dev (s) Relative Performance (Lower is Faster)
cli-latest 3.669s ± 0.089s ▓ 1.02x
cli-next 3.591s ± 0.054s ▓ 1.00x (Fastest)

@kanoru3101 kanoru3101 marked this pull request as ready for review March 2, 2026 16:57
@kanoru3101 kanoru3101 requested review from a team as code owners March 2, 2026 16:57
Copy link
Collaborator

@tatomyr tatomyr left a comment

Choose a reason for hiding this comment

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

Please also add an e2e test with transitive $refs.

Co-authored-by: Andrew Tatomyr <andrew.tatomyr@redocly.com>
@kanoru3101 kanoru3101 requested a review from tatomyr March 3, 2026 09:38
Copy link
Collaborator

@tatomyr tatomyr left a comment

Choose a reason for hiding this comment

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

Almost there. Please also update the PR description and the test name.

@kanoru3101 kanoru3101 requested a review from tatomyr March 4, 2026 11:45
@kanoru3101 kanoru3101 requested a review from JLekawa March 4, 2026 11:45
Copy link
Collaborator

@tatomyr tatomyr left a comment

Choose a reason for hiding this comment

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

Please adjust the changeset according to this and feel free to merge.

@kanoru3101 kanoru3101 merged commit a5ab879 into main Mar 4, 2026
41 checks passed
@kanoru3101 kanoru3101 deleted the fix/resolve-ref-in-path branch March 4, 2026 15:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

snapshot Create experimental release PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants