openapi-generator
openapi-generator copied to clipboard
[REQ] Add TypeScript generator with functions to construct URL's instead of API calls
Request
Add generator that generates TypeScript functions to construct URLs to be used in any fetching library.
Example:
// buildCompanyGet should be generated by openapi
const companyGetUrl = buildCompanyGet(baseUrl, { companyId: "xyz" })
// e.g. returns http://localhost:8080/api/company/xyz
console.log(companyGetUrl)
// use in any fetch library, here Nuxt 3 $fetch
$fetch(companyGetUrl)
This could be very useful if you are using a fetching library which has no generator (In my case $fetch from Nuxt 3) or any other use case. I think this flexibility could also be added to existing generators, like typescript. It could be as easy as extracting the assertion and building of URLs into own functions.
This would be amazing since I have specified the websocket endpoint in my swagger spec
With over 4k issue this will likely never be implemented 😞