swagger-codegen contains a template-driven engine to generate documentation, API clients and server stubs in different languages by parsing your OpenAPI / Swagger definition.
When I generate the java client for -library=resttemplate, I can inject the OAUth2 resttemplate into the generated ApiClient, and do not need to worry about the dealing with the tokens.
When I generate the java client with no libraries (and the swagger file of the API contains the relevant section for OAuth securityScheme, including the tokenUrl), the generated ApiClient does not include any logic of OAuth flow. The api is secured with ClientCredentials grant.
The only reference the generated ApiClient has to Auth is:
`
// Setup authentications (key: authentication name, value: authentication).
authentications = new HashMap<String, Authentication>();
authentications.put("oauth", new OAuth());`
Description
When I generate the java client for -library=resttemplate, I can inject the OAUth2 resttemplate into the generated ApiClient, and do not need to worry about the dealing with the tokens. When I generate the java client with no libraries (and the swagger file of the API contains the relevant section for OAuth securityScheme, including the tokenUrl), the generated ApiClient does not include any logic of OAuth flow. The api is secured with ClientCredentials grant.
The only reference the generated ApiClient has to Auth is: `
Swagger-codegen version
2.3.1
Swagger declaration file content or url
{
Command line used for generation
java -jar swagger-codegen-cli-2.3.1.jar generate -l java -o AccountServiceClientOauth -i swagger.json --group-id com.infra.samples --artifact-id account-service-client-oauth