Closed tommck closed 4 years ago
Third time I'm filing an issue and it might actually be a real issue this time! ;)
If I can get time to do it, I can try to fix this, or at least create a failing unit test
Third time I'm filing an issue and it might actually be a real issue this time! ;)
Well, this time it is a bug indeed ;) Thanks for the PR. Will merge and tweak if needed.
The fix felt a bit awkward, so that's why I put the comment in there about it probably being in the wrong place.
@luisfpg This still seems to be a problem... here's another quick sample JSON file:
{
"openapi": "3.0.1",
"info": {
"title": "Blah"
},
"paths": {},
"components": {
"schemas": {
"Foo.Bar.Baz": {
"required": [
"description",
"childDetails"
],
"type": "object",
"properties": {
"description": {
"type": "string"
},
"childDetails": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Foo.Bar.Baz"
}
}
},
"additionalProperties": false
}
}
}
}
Output:
/* tslint:disable */
export interface Baz {
childDetails: Array<FooBarBaz>;
description: string;
}
:(
I'll open another issue
I tweaked a simple OpenAPI 3.0 spec (file attached) to rename "Pet" to "One.Two.Pet" and have that object contain a reference to itself:
This results in this TS code (entire file):
the "OneTwoPet" does not exist. pets-with-pets.txt