mirror of
https://github.com/postmanlabs/openapi-to-postman.git
synced 2022-11-29 22:05:00 +03:00
Merge pull request #544 from postmanlabs/fix/referencedComponents
Fix/referenced components
This commit is contained in:
@@ -23,6 +23,21 @@ const COMPONENTS_KEYS_30 = [
|
||||
],
|
||||
PROPERTY_DEFINITION = [
|
||||
'properties'
|
||||
],
|
||||
RESPONSE_DEFINITION = [
|
||||
'responses'
|
||||
],
|
||||
REQUEST_BODY_CONTAINER = [
|
||||
'requestBody'
|
||||
],
|
||||
LINKS_CONTAINER = [
|
||||
'links'
|
||||
],
|
||||
HEADER_DEFINITION = [
|
||||
'headers'
|
||||
],
|
||||
CALLBACK_DEFINITION = [
|
||||
'callbacks'
|
||||
];
|
||||
|
||||
module.exports = {
|
||||
@@ -55,6 +70,12 @@ module.exports = {
|
||||
if (EXAMPLE_CONTAINERS.includes(item)) {
|
||||
item = 'examples';
|
||||
}
|
||||
if (REQUEST_BODY_CONTAINER.includes(item)) {
|
||||
item = 'requestBodies';
|
||||
}
|
||||
if (LINKS_CONTAINER.includes(trace[index + 2])) {
|
||||
trace[index + 1] = 'links';
|
||||
}
|
||||
if (PROPERTY_DEFINITION.includes(trace[index + 2])) {
|
||||
trace[index + 1] = 'schemas';
|
||||
}
|
||||
@@ -63,6 +84,15 @@ module.exports = {
|
||||
matchFound = true;
|
||||
break;
|
||||
}
|
||||
if (RESPONSE_DEFINITION.includes(trace[index + 2])) {
|
||||
trace[index + 1] = 'responses';
|
||||
}
|
||||
if (HEADER_DEFINITION.includes(trace[index + 2])) {
|
||||
trace[index + 1] = 'headers';
|
||||
}
|
||||
if (CALLBACK_DEFINITION.includes(trace[index + 2])) {
|
||||
trace[index + 1] = 'callbacks';
|
||||
}
|
||||
}
|
||||
return matchFound ?
|
||||
traceToKey.reverse() :
|
||||
|
||||
Reference in New Issue
Block a user