You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Swagger-codegen is generating duplicate methods in a class when multiple request bodies are defined. This seems to only happen when the title and/or description is included in the scheme for the request body.
error output on packaging
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /Users/cisom/dev/workspace/swagger-codegen/samples/src/main/java/com/sample/api/DefaultApi.java:[183,37] method postDataCall(java.lang.Object,com.sample.ProgressResponseBody.ProgressListener,com.sample.ProgressRequestBody.ProgressRequestListener) is already defined in class com.sample.api.DefaultApi
[ERROR] /Users/cisom/dev/workspace/swagger-codegen/samples/src/main/java/com/sample/api/DefaultApi.java:[225,38] method postDataValidateBeforeCall(java.lang.Object,com.sample.ProgressResponseBody.ProgressListener,com.sample.ProgressRequestBody.ProgressRequestListener) is already defined in class com.sample.api.DefaultApi
[ERROR] /Users/cisom/dev/workspace/swagger-codegen/samples/src/main/java/com/sample/api/DefaultApi.java:[246,17] method postData(java.lang.Object) is already defined in class com.sample.api.DefaultApi
[ERROR] /Users/cisom/dev/workspace/swagger-codegen/samples/src/main/java/com/sample/api/DefaultApi.java:[257,30] method postDataWithHttpInfo(java.lang.Object) is already defined in class com.sample.api.DefaultApi
[ERROR] /Users/cisom/dev/workspace/swagger-codegen/samples/src/main/java/com/sample/api/DefaultApi.java:[270,37] method postDataAsync(java.lang.Object,com.sample.ApiCallback<java.lang.Void>) is already defined in class com.sample.api.DefaultApi
Swagger-codegen version
3.0.34 and 3.0.35-SNAPSHOT
Swagger declaration file content or url
sample.yaml
openapi: 3.0.2info:
title: Sample Serviceversion: '1.0'description: Sample yaml file to recreate bugservers:
- url: 'http://127.0.0.1'description: localpaths:
/sample/v1/paths:
post:
summary: post to pathoperationId: post_dataresponses:
'200':
description: receiveddescription: Send data to the Sample ServicerequestBody:
content:
sample.com/syslog:
schema:
type: stringtitle: SysSysloglogdescription: "Syslog messages separated by `\\n`"format: binarysample.org/unified:
schema:
type: stringtitle: Unifieddescription: "Unified records"format: binarydescription: 'Request Body'required: true
Description
Swagger-codegen is generating duplicate methods in a class when multiple request bodies are defined. This seems to only happen when the title and/or description is included in the scheme for the request body.
error output on packaging
Swagger-codegen version
3.0.34 and 3.0.35-SNAPSHOT
Swagger declaration file content or url
sample.yaml
config file
Command line used for generation
Steps to reproduce
Copy the sample.yaml and config.json below and run the following command.
Once generated
mnv package
will generate the error above showing the duplicate methods in the class.Related issues/PRs
N/A
Suggest a fix/enhancement
Please fix this to allow title and description to be added to the schema of multiple request bodies.
The text was updated successfully, but these errors were encountered: