hey-api / openapi-ts

✨ Turn your OpenAPI specification into a beautiful TypeScript client

Home Page:https://heyapi.vercel.app

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Inconsistent URL Encoding in Generated Services

k9ordon opened this issue · comments

Description

In the services generated by the openapi-ts library, there appears to be an inconsistency in how URLs are encoded. Some URLs are returned URL encoded while others are not. This inconsistency can lead to issues when these URLs are used in requests.

Example

In the generated code, we have services like:

return __request(OpenAPI, {
    method: 'GET',
    url: '%2Fats%2Fjobs',
});

This should be:

return __request(OpenAPI, {
    method: 'GET',
    url: '/ats/jobs',
});

OpenAPI specification (optional)

https://api.kombo.dev/openapi.json

Configuration

npx @hey-api/openapi-ts -i https://api.kombo.dev/openapi.json -o generated

System information (optional)

macos, node v20.11.0, @hey-api/openapi-ts 0.43.0,

Thanks @k9ordon, super helpful to provide the spec. Will see if I can replicate

@k9ordon This is fixed in v0.43.1, please open a new issue if you spot any other problems!

@mrlubos It works perfectly with version 0.43.2. Thanks for the quick fix! 🥳