Skip to content

Commit

Permalink
fix: incorrect detected schema title for deeply inherited schemas
Browse files Browse the repository at this point in the history
  • Loading branch information
RomanHotsiy committed May 12, 2019
1 parent b0e660e commit 7d7b4e3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 1 addition & 5 deletions src/services/OpenAPIParser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ export class OpenAPIParser {
...schema,
allOf: undefined,
parentRefs: [],
title: schema.title || (isNamedDefinition($ref) ? JsonPointer.baseName($ref) : undefined),
};

// avoid mutating inner objects
Expand Down Expand Up @@ -263,11 +264,6 @@ export class OpenAPIParser {
}
}

// name of definition or title on top level
if (schema.title === undefined && isNamedDefinition($ref)) {
receiver.title = JsonPointer.baseName($ref);
}

return receiver;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ Object {
"type": "string",
},
},
"title": undefined,
},
Object {
"allOf": undefined,
Expand All @@ -38,6 +39,7 @@ Object {
"type": "string",
},
},
"title": undefined,
},
],
},
Expand All @@ -59,6 +61,7 @@ Object {
"type": "string",
},
},
"title": undefined,
},
Object {
"allOf": undefined,
Expand All @@ -76,6 +79,7 @@ Object {
"type": "string",
},
},
"title": undefined,
},
],
},
Expand Down

0 comments on commit 7d7b4e3

Please sign in to comment.