swagger-api / swagger-api/swagger-parser

BinarySchema V2 to V3 conversion results in StringSchema being used..

Open
#1,242 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
867
Forks
560
Avg merge
2d 21h
Merged PRs (30d)
7

Description

When using the V3 maven plugin, and a V2 schema with a property such as:

          secret:
            type: string
            format: binary
            minLength: 32

In https://github.com/swagger-api/swagger-parser/blob/master/modules/swagger-parser-v2-converter/src/main/java/io/swagger/v3/parser/converter/SwaggerConverter.java#L951

            result = Json.mapper().convertValue(schema, Schema.class);

schema goes in as BinarySchema (v2) and result comes out as StringSchema (v3)..

This is using swagger-parser-v2-converter 2.0.15.

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

Start at modules/swagger-parser-v2-converter/src/main/java/io/swagger/v3/parser/converter/SwaggerConverter.java around line 951 and reproduce the V2 YAML example through the V3 Maven plugin. Check why converting the V2 BinarySchema produces a V3 StringSchema. Done means the binary property remains represented as the appropriate binary schema after conversion, with its stated constraints preserved.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
backend-api-design
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.