You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Expected behavior
Docs appears without an error, or shows an error that a user can fix or work-around the problem.
Minimal reproducible OpenAPI snippet(if possible)
# oas.ymlopenapi: "3.1.0"info:
title: "Redoc JSON pointer parsing bug"version: "0.0.1"paths:
/foo:
get:
responses:
"200":
content:
application/json:
schema:
$ref: "./responses.yml#/StringResponse/application~1json/schema"/bar:
get:
responses:
"200":
content:
application/json:
schema:
$ref: "./responses.yml#/NumberResponse/application~1json/schema"# Using this ref instead of the NumberResponse works#$ref: "./responses.yml#/StringResponse/application~1json/schema"# Using this (no slash in pointer tokens) ref instead of the NumberResponse works#$ref: "./responses.yml#/ObjectResponse/application-json/schema"
Hi @pocka, after small investigation, we know where is the problem. It is hard to fix. We should decode $ref before get it. But if we cover current case we broke others.
Before we fix that, please, avoid using escape characters in ref. You can do it like that:
So I don't immediately see any workaround for avoiding the ~1 as paths need to start with a slash?
Except for upgrading to OpenAPI 3.1 which supports named reusable path objects.
Describe the bug
Redoc shows an error screen when,
$ref
pointing external file (I'm not sure about more than two)~1
, escaped slash character, in its JSON pointer tokensThis does not happen if the value of two
$ref
s references are same or the path does not include~1
.The error message for
is
(Reproduction CodeSandbox)
Expected behavior
Docs appears without an error, or shows an error that a user can fix or work-around the problem.
Minimal reproducible OpenAPI snippet(if possible)
Screenshots
None.
Additional context
None.
The text was updated successfully, but these errors were encountered: