New issue
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
[BUG] [JAVA] [Client] Using different Content Types results in Accept Header [Ljava.lang.String;@XXXXXXXX #18590
Comments
looks like it's related to #18092 @larsenf-els can you please take a look when you've time? |
Yeah, facing same issue |
@manuelnagler @wing328 @yasstec: |
I cannot reproduce the issue you are facing. I may need some additional information, and it could be due to me calling the wrong Feign client generator? I created a small project here at GitHub that uses Gradle to call the OpenAPI Generator 7.5.0 on the provided OpenAPI specification file used for producing the error: https://github.com/larsenf-els/feign-openapi-generator-test Hava a look at the build.gradle.kts file. It generates this file: package com.example.api;
import com.example.invoker.ApiClient;
import com.example.invoker.EncodingUtils;
import com.example.model.ApiResponse;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import feign.*;
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-05-17T10:57:18.694179+02:00[Europe/Copenhagen]", comments = "Generator version: 7.5.0")
public interface DefaultApi extends ApiClient.Api {
/**
*
*
* @param body (optional)
* @return byte[]
*/
@RequestLine("POST /demo")
@Headers({
"Content-Type: application/text",
"Accept: application/pdf,application/text",
})
byte[] demoPost(String body);
/**
*
* Similar to <code>demoPost</code> but it also returns the http response headers .
*
* @param body (optional)
* @return A ApiResponse that wraps the response boyd and the http headers.
*/
@RequestLine("POST /demo")
@Headers({
"Content-Type: application/text",
"Accept: application/pdf,application/text",
})
ApiResponse<byte[]> demoPostWithHttpInfo(String body);
} |
I noticed, that your initial pullrequest includes this change: https://github.com/OpenAPITools/openapi-generator/pull/18092/files#diff-d50fdea014963dc2aad9184a546a9005256203dce025f8b43255dd35aa3197ee We were using a local copy of the api.mustache which we forgot to update. This issue is resolved. |
Description
Regression in 7.5.0: Using different Content Types results in Accept Header generated as [Ljava.lang.String;@xxxxxxxx
openapi-generator version
Broken since 7.5.0.
7.4.0 works as expected
OpenAPI declaration file content or url
Steps to reproduce
Generate e.g. a feign client from the spec.
Result:
Expected:
The Accept Header is not serialized properly into the generated interface.
The text was updated successfully, but these errors were encountered: