mirror of
https://github.com/postmanlabs/openapi-to-postman.git
synced 2022-11-29 22:05:00 +03:00
Add URI Decoding to getRefObject.
This commit is contained in:
@@ -1205,9 +1205,11 @@ module.exports = {
|
|||||||
savedSchema = $ref.split('/').slice(1).map((elem) => {
|
savedSchema = $ref.split('/').slice(1).map((elem) => {
|
||||||
// https://swagger.io/docs/specification/using-ref#escape
|
// https://swagger.io/docs/specification/using-ref#escape
|
||||||
// since / is the default delimiter, slashes are escaped with ~1
|
// since / is the default delimiter, slashes are escaped with ~1
|
||||||
return elem
|
return decodeURIComponent(
|
||||||
.replace(/~1/g, '/')
|
elem
|
||||||
.replace(/~0/g, '~');
|
.replace(/~1/g, '/')
|
||||||
|
.replace(/~0/g, '~')
|
||||||
|
);
|
||||||
});
|
});
|
||||||
// at this stage, savedSchema is [components, part1, parts]
|
// at this stage, savedSchema is [components, part1, parts]
|
||||||
// must have min. 2 segments after "#/components"
|
// must have min. 2 segments after "#/components"
|
||||||
|
|||||||
@@ -230,6 +230,7 @@ paths:
|
|||||||
stype: form
|
stype: form
|
||||||
schema:
|
schema:
|
||||||
$ref: '#/components/parameters/Tuhin'
|
$ref: '#/components/parameters/Tuhin'
|
||||||
|
- $ref: '#/paths/~1pets~1%7Bid%7D/get/parameters/0'
|
||||||
servers:
|
servers:
|
||||||
- url: https://{username}.gigantic-server.com:{port}/{basePath}
|
- url: https://{username}.gigantic-server.com:{port}/{basePath}
|
||||||
description: Common url for all operations in this path
|
description: Common url for all operations in this path
|
||||||
|
|||||||
Reference in New Issue
Block a user