Open BBKolton opened 6 years ago
(This is my first real issue I've reported, please let me know if you need more info!)
This is a great report for an issue.
If I remember well, something similar have already be reported and fixed. Can you try with the last released version: 3.2.2
instead of 3.0.2
?
Looks like the issue in the HealthApi
file is resolved, but now servicenameApi.java
, a generated file under src/main/java/com/company/team/service/client/v1/serviceApi.java
fails. I assume a fix to the health api file was not propogated.
public com.squareup.okhttp.Call getHealthDeepCall(final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object localVarPostBody = new Object();
// create path and map variables
String localVarPath = "/health/deep";
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"text/plain""application/json" // same problem, comma omitted
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
I can not reproduce your error... I checked the code and the templates, and for me it should work. I also try to did to generate a java client to reproduce the error you are describing in the generated code. No luck.
To investigate further, please tell the exact spec (JSON, YAML) you are using and the exact configuration parameters in your pom.xml.
For references I found the issue I was mentioning earlier: #443
Description
With two different defined response types for two different response codes, the generated file has a missing comma which crashes the build.
openapi-generator version
3.0.2
OpenAPI declaration file content or url
Deep in the target folder hierarchy, the
HealthApi.java
file has this section which throws a syntax errorCommand line used for generation
mvn clean install
Steps to reproduce
Create an API document with a route. Attempt to build the file using the
openapi-generator-maven-plugin
Suggest a fix/enhancement
Ensure that multiple options for return types create commas inbetween them
(This is my first real issue I've reported, please let me know if you need more info!)