swagger-api / swagger-api/swagger-codegen

keyParamName has no sanitized form

Open
#5,001 2 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Hi

I'm adapting our spring(boot) mustache files to comply to our security needs. However we've noticed that the CodegenSecurity class is not as well defined as CodegenParameter.

For our use case we have an api-key defined as header in our specification. If we try to get this in our code, we can only get the keyParamName. We need a sanitized form to use this as java variable name.

If we define a header as param, we can get the sanitized name.

It would be nice if we had the same baseName and paramName options for this keyParamName.

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 reading CodegenSecurity and comparing its keyParamName handling with CodegenParameter's baseName and paramName options. Inspect the Spring Boot Mustache templates that consume CodegenSecurity; the work is done when sanitized equivalents are available for keyParamName and usable as Java variable names.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, openapi, spring-boot
Domain
api, tooling
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.