Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • O openapi-generator
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 3,476
    • Issues 3,476
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 402
    • Merge requests 402
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • OpenAPI Tools
  • openapi-generator
  • Issues
  • #5959
Closed
Open
Issue created Apr 16, 2020 by Administrator@rootContributor3 of 6 checklist items completed3/6 checklist items

[BUG][JAVA] setBearerToken method not generated

Created by: toymachiner62

Bug Report Checklist

  • Have you provided a full/minimal spec to reproduce the issue?
  • Have you validated the input using an OpenAPI validator (example)?
  • What's the version of OpenAPI Generator used?
  • Have you search for related issues/PRs?
  • What's the actual output vs expected output?
  • [Optional] Bounty to sponsor the fix (example)
Description

Generating a Java client with version 4.3.0 does not generate the method setBearerToken. I have the security scheme defined in my .oas file.

The example petstore has this method generated here https://github.com/OpenAPITools/openapi-generator/blob/5740348902a29e2ad1e538b1f27bf13ec8031a23/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/ApiClient.java#L160-L172

openapi-generator version

4.3.0

OpenAPI declaration file content or url
"securitySchemes": {
      "Bearer": {
        "type": "http",
        "description": "Bearer Authorization using User Token credentials",
        "scheme": "bearer"
      }
    }
Command line used for generation
$ openapi-generator generate -i https://sdk.catalytic.com/v1.0.1-pre-35/swagger/v1/swagger.json -g java -o new --additional-properties=apiPackage=org.catalytic.sdk.api,modelPackage=org.catalytic.sdk.model,dateLibrary=java8,groupId=org.catalytic,invokerPackage=org.catalytic.sdk,java8=true,hideGenerationTimestamp=true
Steps to reproduce
Related issues/PRs
Suggest a fix
Assignee
Assign to
Time tracking