Skip to content

[BUG][JAVA Native] No way to set bearer token #21487

@inemtsev

Description

@inemtsev
Description

We are providing the following in our spec:

components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

# and for each endpoint
      security:
        - bearerAuth: [ ]

But, there generated java client provides no way to set the bearer token :(

I am using the latest generator version available with the following configuration:

openApiGenerate {
    generatorName.set("java")
    inputSpec.set(localSpecFile.path)
    outputDir.set("${buildDir}/generated")
    modelPackage.set("com.companyName.capi.generated.model")
    apiPackage.set("com.companyName.capi.generated.api")
    packageName.set("com.companyName.capi.generated")
    configOptions.set(
        mapOf(
            "library" to "native",
            "asyncNative" to "true",
            "dateLibrary" to "java8"
        )
    )
}
openapi-generator version

Using generator 7.14.0

Suggest a fix

I am either missing some approach, or this is a bug.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions