redoc
redoc copied to clipboard
Pattern properties do not load external $refs
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
Just ran into this myself. All other $ref's are properly bundled, but every $ref inside patternProperties is not resolved and left as is, leading to an any type.
Thanks for the issue and explanation @tfedor. I had a quick look at it and it's not clear to me what's technically correct here. OpenAPI supports $refs in quite specific limited locations, but JSON Schema would probably think this was valid, and Redoc will typically attempt to resolve whatever you give it. Moving the references into the same file produces what I think you were expecting (example attached).
openapi.yaml.txt