OpenAPITools / OpenAPITools/openapi-generator

[BUG][java-helidon-server] Use of format binary leads to code with missing import

Open
#19,739 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Issue: Bug
Dominant language
Java
Stars
26.8k
Forks
7.7k
PR merge metrics
PR metrics pending

Description

Description

When using a schema with type:string and format:binary, the generated code is missing the import for java.io.InputStream, so the code can not be compiled

openapi-generator version

7.8.0 gradle plugin

OpenAPI declaration file content or url

bugs.json

Generation Details

Generated via the gradle plugin

openApiGenerate {
    generatorName.set("java-helidon-server")
    inputSpecRootDirectory.set("$rootDir/specs/")
    outputDir.set("$rootDir/src")
    apiPackage.set("my.package.api")
    modelPackage.set("my.package.model")
    invokerPackage.set("my.package.api.services")
    validateSpec.set(true)
    generateApiTests.set(false)
    configOptions.set([
            apiPackage          : "my.package.services",
            modelPackage        : "my.package.model",
            invokerPackage        : "my.package.services",
            dateLibrary         : "java8",
            gradleProject       : "true",
            groupId             : "my.package",
            artifactId          : "example",
            library             : "se",
            helidonVersion      : "$helidonVersion",
            serializationLibrary: "jackson",
            fullProject         : "false",
            useAbstractClass    : "true",
            "x-helidon-groupBy" : "first-path-segment"
    ])
}
Steps to reproduce

Use the java-helidon-server plugin to generate the server implementation

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 with the linked bugs.json OpenAPI declaration and reproduce generation through the java-helidon-server Gradle plugin using the shown configuration. Inspect the generated server sources and the generator entry points for binary string handling. Done means the generated code for format:binary includes the required java.io.InputStream import and compiles.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
api, backend
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.