We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
An example schema:
{ "openapi": "3.0.1", "info": { "title": "Blah", "version": "1" }, "paths": {}, "components": { "schemas": { "Clazz": { "type": "object", "properties": { "parentProps": { "type": "string" } } }, "Foo.Bar.Baz.Clazz": { "allOf": [{ "$ref": "#/components/schemas/Clazz" }, { "type": "object", "required": [ "arrayProperty" ], "properties": { "refProperty": { "$ref": "#/components/schemas/Foo.Bar.Baz.Clazz" }, "arrayProperty": { "type": "array", "items": { "$ref": "#/components/schemas/Foo.Bar.Baz.Clazz" } }, "objectProperty": { "type": "object", "required": [ "nestedArray", "nestedRef" ], "properties": { "nestedArray": { "type": "array", "items": { "$ref": "#/components/schemas/Foo.Bar.Baz.Clazz" } }, "nestedRef": { "$ref": "#/components/schemas/Foo.Bar.Baz.Clazz" } } } } }] } } } }
Produces wrong typescript:
import { Clazz } from '../../../../models/clazz'; export type Clazz = Clazz & { 'refProperty'?: Clazz; 'arrayProperty': Array<Clazz>; 'objectProperty'?: { 'nestedArray': Array<Clazz>; 'nestedRef': Clazz; }; };
I think the only way to do this is to always use qualified name, so it will look roughly like:
import { Clazz } from '../../../../models/clazz'; export type FooBarBazClazz = Clazz & { 'refProperty'?: FooBarBazClazz; 'arrayProperty': Array<FooBarBazClazz>; 'objectProperty'?: { 'nestedArray': Array<FooBarBazClazz>; 'nestedRef': FooBarBazClazz; }; };
Thoughts?
The text was updated successfully, but these errors were encountered:
FYI: I've made a workaround https://github.com/juneidy/ng-openapi-gen/tree/unqualified-bug
Let me know if there's any improvement you have in mind.
Sorry, something went wrong.
No branches or pull requests
An example schema:
Produces wrong typescript:
I think the only way to do this is to always use qualified name, so it will look roughly like:
Thoughts?
The text was updated successfully, but these errors were encountered: