Open Beauchaj opened 2 months ago
Hey @Beauchaj, I had a look at this and it seems to be affecting only the legacy clients. Both generated types and services look okay with only underscore in query parameter when using the new Fetch API client. If this issue is urgent, I'd be open to a pull request, but it sounds like an edge case?
Description
An OpenAPI Query Parameter with the name
_
(or any_
within the parameter name) fails to generate the corresponding property name underservices.gen.ts
(Fetch
client). Any instance of_
is being stripped from the resulting value (leading, trailing, or otherwise) in the translation of thesnake_case
OpenAPI parameter key to thecamelCase
property name, but if the parameter name is only_
the generated ts is broken.Noting: If the parameter was
_
the query parameter generated underservices.gen.ts
is:instead of
Also noting: Using
_
as a name or character parameter in OpenAPI queries does not break the OpenAPI specification.Expected output
types.gen.ts
services.gen.ts
Instead got output
types.gen.ts
services.gen.ts
OpenAPI specification (optional)
Configuration
Just defaults, so standard fetch client generation
npx @hey-api/openapi-ts -i path/to/openapi.yaml -o src/client
System information (optional)