[REQ][Java] Customize scopes separator in generated API client
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
According to the RFC 6749 section 3.3 : "The value of the scope parameter is expressed as a list of space-delimited, case-sensitive strings"
So from my point of view, generate a comma separated list of scopes is a bug ?
As work around, I used this piece of code :
// Create custom authentication method with list of scopes delimited by space
OAuth customOAuth = new OauthClientCredentialsGrant(null,
"https://myApiManager/oauth2/token",
"scope1 scope2 scope3");
// Create ApiClient without using declared Oauth method
ApiClient apiClient = new ApiClient();
// register our custom authentication method
apiClient.addAuthorization("custom-client-credential", customOAuth);
// set credentials
apiClient.setClientCredentials("__Consumer_Key__","__Consumer_Secret__");