We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using "@hey-api/openapi-ts": "^0.62.3", "@hey-api/client-axios": "^0.5.1",
Client config:
export default defineConfig({ client: '@hey-api/client-axios', input: 'c:/tmp/swagger.json', output: 'src/app/_lib/_generated-client', plugins: [ ...defaultPlugins, { name: '@hey-api/schemas', type: 'json', }, ], });
This is part of the swagger:
"/api/meeting-protocols": { "get": { "tags": [ "MeetingProtocol" ], "responses": { "200": { "description": "Success", "content": { "text/plain": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/MeetingProtocol" } } }, "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/MeetingProtocol" } } }, "text/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/MeetingProtocol" } } } } } } },
Generates this sdk:
export const getApiMeetingProtocols = <ThrowOnError extends boolean = false>(options?: Options<GetApiMeetingProtocolsData, ThrowOnError>) => { return (options?.client ?? client).get<GetApiMeetingProtocolsResponse, unknown, ThrowOnError>({ responseType: 'text', url: '/api/meeting-protocols', ...options }); };
The problem is, it's not return an array but the plain string. When I change it manually to "reponseType: 'json', then it works fine.
I can't find a way to tell openapi-ts to generate 'json' instead of 'text'. Any help would be appreciated!
The text was updated successfully, but these errors were encountered:
Start a new pull request in StackBlitz Codeflow.
Sorry, something went wrong.
Have the same exact issue, using the same versions of api and axios client.
No branches or pull requests
Description
Using
"@hey-api/openapi-ts": "^0.62.3",
"@hey-api/client-axios": "^0.5.1",
Client config:
This is part of the swagger:
Generates this sdk:
The problem is, it's not return an array but the plain string.
When I change it manually to "reponseType: 'json', then it works fine.
I can't find a way to tell openapi-ts to generate 'json' instead of 'text'.
Any help would be appreciated!
The text was updated successfully, but these errors were encountered: