You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In both of these examples I think it would be better if the data simply appeared as Photo, as per the component name in the schema.
I believe this would be possible if openapi-typescript generated individual interfaces for each component, rather than one interface with components as nested objects. When TypeScript prints the type e.g. inside hover tooltips and error messages, TypeScript will preserve the name of interfaces rather than inlining their contents.
Furthermore, this change is required to force TypeScript to compute the type in the first example:
Description
When inspecting
data
returned byopenapi-fetch
, the type can be quite difficult to read, and the appearance seems to vary. For example:index.ts
:Reproduction
In case it helps for testing, here's the schema JSON I used.
Expected result
In both of these examples I think it would be better if the data simply appeared as
Photo
, as per the component name in the schema.I believe this would be possible if openapi-typescript generated individual interfaces for each component, rather than one interface with components as nested objects. When TypeScript prints the type e.g. inside hover tooltips and error messages, TypeScript will preserve the name of
interface
s rather than inlining their contents.Furthermore, this change is required to force TypeScript to compute the type in the first example:
With I tested both of those changes, this is what I was able to achieve:
(I still need to figure out why
Photo
is still being inlined in the first example.)Checklist
The text was updated successfully, but these errors were encountered: