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
First, thanks for your work here people, I really like having strong typing from backend to the frontend and your libraries are perfect for this 👌
At my work, we did a small additionnal wrapper that rewrite part of the types so we can access them directly like "natural" types instead of having to use the nested access through components["schemas"]["MyApiType"]
Thanks for the suggestion @Aschen.
This is a common request, but it's difficult to come up with a scheme that exposes top-level components in a way that satisfies everyone. It's possible (easy even) to have components whose names are not valid JS identifiers, and it's also not uncommon to run into cases where several exported things (such as component schemas and enums) end up colliding in the types namespace.
For 8.x we're looking at providing APIs to serve as extension points for use cases like these, including functions for translating component schema names to JS identifiers; this is on our radar, however it is unlikely that this feature will make it to 7.x or 8.x in the form proposed.
Description
Hello !
First, thanks for your work here people, I really like having strong typing from backend to the frontend and your libraries are perfect for this 👌
At my work, we did a small additionnal wrapper that rewrite part of the types so we can access them directly like "natural" types instead of having to use the nested access through
components["schemas"]["MyApiType"]
I was thinking about opening a PR here to add an option to generate types from components like this but I wanted your opinion on it first.
Extra
The text was updated successfully, but these errors were encountered: