swagger-api / swagger-api/swagger-codegen
[JAVA] type=string format=byte not serialised correctly in header
Nobody has claimed this yet.
- Dominant language
- Mustache
- Stars
- 17.8k
- Forks
- 6k
- PR merge metrics
- No merged PRs in 30d
Description
Description
I have a byte[] (type=string format=byte) as header parameter. For creating (the header of) the request for calling the operation ApiClient.parameterToString(Object) will be used. While this uses JSON for handling date types, it uses Object.toString() for all other types including byte[]. With the changes of #4824 the byte[] should be serialised properly when delegating to JSON instead of calling Object.toString().
Swagger-codegen version
swagger-codegen-cli-3.0.8
Swagger declaration file content or url
Command line used for generation
Steps to reproduce
Related issues/PRs
#4824
Suggest a fix/enhancement
Apply the special treatment of byte[] introduced with #4824 also to ApiClient.parameterToString(Object). And fix this in all relevant files of the template ApiClient.mustache (see #9411).
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with ApiClient.parameterToString(Object) and the ApiClient.mustache templates referenced in the issue. Compare their byte[] handling with the special treatment introduced by #4824, and review #9411 for related template files. Done means byte[] header parameters are serialized correctly across all relevant templates.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100