swagger-api / swagger-api/swagger-codegen

Generated auth_settings in configuration.py is empty for bearerAuth

Open
#12,185 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Mustache
Stars
17.8k
Forks
6k
PR merge metrics
No merged PRs in 30d

Description

Description

Generated auth_settings in configuration.py is empty for bearerAuth.

This issue is reported years ago (https://github.com/swagger-api/swagger-codegen/issues/10060) but no response yet, so I open a new one here.

Swagger-codegen version

3.0.46

Swagger declaration file content or url

openapi.yaml

components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
security:
- bearerAuth: []

generated code

    def auth_settings(self):
        """Gets Auth Settings dict for api client.

        :return: The Auth Settings information dict.
        """
        return {
        }
Command line used for generation

https://editor-next.swagger.io/

Steps to reproduce
Related issues/PRs
Suggest a fix/enhancement

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 by reproducing the issue with the provided openapi.yaml in editor-next.swagger.io, then inspect generated configuration.py and the handling of the bearerAuth security scheme. Done means the generated Python client's auth_settings is no longer empty for this bearerAuth declaration.

Written by the indexing model from the issue text.

Assessment

Tech stack
openapi, python
Domain
api, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.