OpenAPITools / OpenAPITools/openapi-generator

[JAVA] Support request

Open
#17,219 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
26.8k
Forks
7.7k
PR merge metrics
PR metrics pending

Description

Hello, i am using openapi-generator in Java gradle plugin
plugins { id "org.openapi.generator" version "6.3.0" }
for generating Api Controller from Swagger in yaml.

I have an Authorization header in swagger
authorization:
name: Authorization
in: header
description: JWT token.
required: true
schema:
type: Jwt
example: Bearer 1234567890

and in generated API i need to make it not just like another headers
@NotNull @RequestHeader(value = "Authorization", required = true) String authorization,
but i need to change its type form String to Jwt and make it hidden and add @AuthenticationPrincipal annotation to it, so it will look like this
@Parameter(hidden = true) @AuthenticationPrincipal Jwt jwt.

I managed to change type to Jwt by using import mappings:
importMappings = [ "Jwt" : "org.springframework.security.oauth2.jwt.Jwt" ], and now i need help with adding annotation and making it hidden.

Any suggestions?

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

The issue identifies the Java Gradle plugin, the OpenAPI YAML authorization schema, and the generated API controller; start by tracing how this header is rendered. Determine whether the requested Jwt parameter and annotations are configurable, and define done as generated output matching the requested hidden authentication parameter.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, spring
Domain
api, tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.