swagger-api / swagger-api/swagger-codegen-generators

[JAVA] type:string format:byte is not mapped to byte[]

Open
#412 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Mustache
Stars
299
Forks
439
PR merge metrics
No merged PRs in 30d

Description

I have the following property described with the following json:

"hash": {
          "type": "string",
          "format": "byte"
        }

In swagger codegen v2.* this will be generated with type byte[] using resttemplate as library (jackson converts automatically using base64 format string)

In latest swagger codegen v3.09 this will be generated with type string. In this way the caller must do the conversion in base64 format string)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Compare the Java output produced by swagger codegen v2.* with the output from v3.09 when the schema uses type string and format byte with the resttemplate library. Check how Jackson handles the generated value and confirm that the generated type and base64 conversion behavior match the v2.* result.

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
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.