mirror of
https://github.com/Redocly/redoc.git
synced 2024-11-26 02:23:43 +03:00
fix: crash when $ref is url encoded
reported by @mikunn
This commit is contained in:
parent
343f51a867
commit
bdf60794f3
|
@ -82,7 +82,7 @@
|
|||
"json-schema-ref-parser": "^3.3.1",
|
||||
"mobx": "^3.3.0",
|
||||
"mobx-react": "^4.3.3",
|
||||
"openapi-sampler": "^1.0.0-beta.1",
|
||||
"openapi-sampler": "1.0.0-beta.8",
|
||||
"prismjs": "^1.8.1",
|
||||
"prop-types": "^15.6.0",
|
||||
"react-dropdown": "^1.3.0",
|
||||
|
|
|
@ -89,6 +89,7 @@ export class OpenAPIParser {
|
|||
let res;
|
||||
if (this.spec === undefined) return;
|
||||
if (ref.charAt(0) !== '#') ref = '#' + ref;
|
||||
ref = decodeURI(ref);
|
||||
try {
|
||||
res = JsonPointer.get(this.spec, decodeURIComponent(ref));
|
||||
} catch (e) {
|
||||
|
|
|
@ -4670,9 +4670,9 @@ ono@^4.0.2:
|
|||
dependencies:
|
||||
format-util "^1.0.3"
|
||||
|
||||
openapi-sampler@^1.0.0-beta.1:
|
||||
version "1.0.0-beta.7"
|
||||
resolved "https://registry.yarnpkg.com/openapi-sampler/-/openapi-sampler-1.0.0-beta.7.tgz#4932a3994067af86f95cb912ee56d01123e27d88"
|
||||
openapi-sampler@1.0.0-beta.8:
|
||||
version "1.0.0-beta.8"
|
||||
resolved "https://registry.yarnpkg.com/openapi-sampler/-/openapi-sampler-1.0.0-beta.8.tgz#bf43ff47737fc4e1f988d0e2082d49788f41dead"
|
||||
dependencies:
|
||||
json-pointer "^0.6.0"
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user