-
-
Notifications
You must be signed in to change notification settings - Fork 603
Closed
Labels
enhancementNew feature or requestNew feature or requestopenapi-tsRelevant to the openapi-typescript libraryRelevant to the openapi-typescript library
Description
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"]
// Before
import { components } from './openapi-types'
function foobar(person: components["schemas"]["Person"]) {
// ...
}
// After
import { Person } from './openapi-types'`
function foobar(person: Person) {
// ...
}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
- I’m willing to open a PR (see CONTRIBUTING.md)
christopher-caldwell
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requestopenapi-tsRelevant to the openapi-typescript libraryRelevant to the openapi-typescript library