Open
Description
openapi-typescript version
7.4.4
Node.js version
22.13.1
OS + version
macOS
Description
I expected the generated types to use the name
of the parameter, but they don't. Is this intended?
Reproduction
packages/domain/specs/unsplash.json
:
{
"openapi": "3.0.0",
"components": {
"parameters": {
"perPageParam": {
"name": "per_page",
"in": "query",
"schema": {
"type": "integer",
"minimum": 1,
"default": 10
}
}
}
}
}
Expected result
Result:
packages/domain/src/gen/unsplash.ts
:
/**
* This file was auto-generated by openapi-typescript.
* Do not make direct changes to the file.
*/
export type paths = Record<string, never>;
export type webhooks = Record<string, never>;
export interface components {
schemas: never;
responses: never;
parameters: {
readonly perPageParam: number;
};
requestBodies: never;
headers: never;
pathItems: never;
}
export type $defs = Record<string, never>;
export type operations = Record<string, never>;
I was hoping for this instead:
parameters: {
- readonly perPageParam: number;
+ readonly per_page: number;
};
Required
- My OpenAPI schema is valid and passes the Redocly validator (
npx @redocly/cli@latest lint
)
Extra
- I’m willing to open a PR (see CONTRIBUTING.md)