Redocly / Redocly/redoc

Pattern properties do not load external $refs

Open
#2,387 3 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

openapi Type: Bug
Dominant language
TypeScript
Stars
25.9k
Forks
2.4k
Avg merge
13h 10m
Merged PRs (30d)
4

Description

Describe the bug
Pattern properties do not load external $refs, it seems to work if the $refs are local, but I didn't properly test it

Expected behavior
$refs should properly load external files

Minimal reproducible OpenAPI snippet(if possible)
test.yaml

openapi: 3.1.0
info:
  title: "Example"
  version: "1.0"
  description: "Example"
paths:
  "/test/":
    get:
      summary: Example
      responses:
        200:
          description: List of shops and their details
          content:
            "application/json":
              schema:
                type: object
                properties:
                  "working":
                    $ref: "testobj.yaml"
                patternProperties:
                  "not-working":
                    $ref: "testobj.yaml"

testobj.yaml

type: object
properties:
  key:
    type: number

Screenshots
image

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the issue with test.yaml and the referenced testobj.yaml, comparing the properties and patternProperties cases. Trace how external $refs are loaded for the OpenAPI 3.1 schema and verify that the patternProperties reference renders or resolves like the local and properties references.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
api
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.