Resolve model names in OAS3 (fixes #3457)

This commit is contained in:
Kyle Shockey
2017-07-28 12:12:12 -07:00
parent e7e03f2e44
commit 9c31b14731

View File

@@ -282,9 +282,13 @@ export class Model extends Component {
} }
getModelName =( ref )=> { getModelName =( ref )=> {
console.log({ref})
if ( ref.indexOf("#/definitions/") !== -1 ) { if ( ref.indexOf("#/definitions/") !== -1 ) {
return ref.replace(/^.*#\/definitions\//, "") return ref.replace(/^.*#\/definitions\//, "")
} }
if ( ref.indexOf("#/components/schemas/") !== -1 ) {
return ref.replace("#/components/schemas/", "")
}
} }
getRefSchema =( model )=> { getRefSchema =( model )=> {