Closed MitchellMonaghan closed 4 years ago
I'm not sure how this should work, maybe you can explain a little bit more. I agree the way SwaggerUI + tsoa produced api description interact here is not ideal, but we can either $ref/link type aliases for reusability, or inline all type aliases. If we inline, it's imo. harder to even worse, as reused definitions lead to more understandable API descriptions.
The distinction based on "is this a type alias typescript ships with" seems too arbitrary, I'd prefer to keep treating all aliases equally and create a schema for every type alias reference in your code, as the JSON schema draft OpenAPI uses does not allow us to apply arguments to a schema.
I hope we can find a better way to handle this in future versions of OpenAPI, 3.1 should be right around the corner and the JSON Schema draft it uses allows us to write some pretty advanced schemas automatcally.
Sorry I didn't really understand your response. Still a typescript noob/learning and I don't know any of the internals for this project.
To me its odd that the right hand side of the assignment is logged as a type I'm using. Its the value/definition not a different type I explicitly defined. I think when defining a type only the left hand side should be used. Maybe this isn't possible or causes other issues I don't know.
Thanks for looking into it, maybe my suggestion is dumb.
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days
When I use a Typescript utility type like so:
The swagger docs contain both OmitUserCreateInput.id-or-createdAt-or-lastPasswordChange-or-lastLogin-or-confirmed-or-failedLoginAttempts-or-locked-or-banned
and
UserCreationParams
Is there a way to hide/remove the Omit_ one? This is just a extra type thats the same as the clean named one and this just creates noise and harder to read docs.