swagger-api / swagger-api/swagger-codegen

[JAVA] Using API Key in Swagger with JAVA

Open
#7,090 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

General: Suggestion help wanted
Dominant language
Mustache
Stars
17.8k
Forks
6k
PR merge metrics
No merged PRs in 30d

Description

Description

I have created a YAML file with the Swagger Editor (Local). I used API keys as security. I then downloaded the server source code via the Swagger Editor. in the Java codes, the API-KEY does not appear, if I test the server I can use the calls without API-KEY, even though this is defined differently in the YAML file. Am I doing something wrong, is my approach wrong or is this an error generating the source code?

Swagger-codegen version

Swagger Editor
Version 2.10.3

Swagger declaration file content or url
Command line used for generation

no command line i use the editor

Steps to reproduce

N/A
swagger (4).yaml.zip

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 attached swagger.4.yaml and the Java server generated through Swagger Editor 2.10.3. Reproduce the generated server behavior against the declared api_key and app_id security definitions, then compare it with the expected protected requests. Done means the generated Java server enforces the YAML-defined API-key requirements, with the result confirmed by a reproducible test case.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
api, backend, security
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.