OpenAPITools / OpenAPITools/openapi-generator

[REQ][Java] Customize scopes separator in generated API client

Open
#18,169 2 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Is your feature request related to a problem? Please describe.

Api Client is generated with scopes that are comma separated and there is no way to change it.

See https://github.com/OpenAPITools/openapi-generator/blob/master/modules/openapi-generator/src/main/resources/Java/libraries/feign/ApiClient.mustache#L110

Some Oauth services require scopes to be space separated.

Describe the solution you'd like

It would be nice to be able to change default separator for scopes in generated client.

Describe alternatives you've considered

Workaround is to list all the scopes as a single, coma separated scope in yaml file.

Additional context

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 modules/openapi-generator/src/main/resources/Java/libraries/feign/ApiClient.mustache around line 110 and trace how the Java Feign generator supplies template options. Make the generated client's OAuth scope separator configurable rather than fixed to commas. Done means a generated client can use a space-separated scope value for services that require it, without the YAML workaround.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.