Skip to content

Commit 8ac2af2

Browse files
committed
Fix endpoints main response type
1 parent e860a69 commit 8ac2af2

3 files changed

Lines changed: 3 additions & 3 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@povio/openapi-codegen-cli",
3-
"version": "0.10.4",
3+
"version": "0.10.5",
44
"main": "./dist/index.js",
55
"bin": {
66
"openapi-codegen": "./dist/sh.js"

src/generators/core/endpoints/getEndpointsFromOpenAPIDoc.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1490,7 +1490,7 @@ describe("getEndpointsFromOpenAPIDoc", () => {
14901490
requestFormat: "application/json",
14911491
response: "z.string()",
14921492
responseDescription: "Successful operation",
1493-
responseFormat: "application/json",
1493+
responseFormat: "application/xml",
14941494
responseObject: {
14951495
content: {
14961496
"application/json": { schema: { type: "string" } },

src/generators/core/endpoints/getEndpointsFromOpenAPIDoc.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ export function getEndpointsFromOpenAPIDoc(resolver: SchemaResolver) {
160160
if (responseZodSchema) {
161161
const status = Number(statusCode);
162162

163-
if (isMainResponseStatus(status)) {
163+
if (isMainResponseStatus(status) && !endpoint.response) {
164164
endpoint.response = responseZodSchema;
165165
endpoint.responseObject = responseObj;
166166
endpoint.responseDescription = responseObj.description;

0 commit comments

Comments
 (0)