-
-
Notifications
You must be signed in to change notification settings - Fork 7.3k
Description
Description
Java code to retrieve clientCredentials from tokenURL serve is not be generated from an OpenApi 3.0.1 YAML file. Code is generated to add the bearer authorization to the requests, but there is no code to retrieve the authorization so OAuth2 doesn't work. Nothing is added to the DefaultApi.java file regarding retrieving the token. Note the tokenUrl is not the issue as I've tried replacing that with a full URL as opposed to a path, but the generated code doesn't change.
openapi-generator version
Tried all versions from 3.0.2 to 4.0.0-SNAPSHOT
OpenAPI declaration file content or url
components:
securitySchemes:
accessCode:
type: oauth2
flows:
clientCredentials:
tokenUrl: /oauth/token
scopes:
write: allows modifying resources
read: allows reading resources
upload: allows upload streams
download: allows downloading streamsHere's the full YAML file: https://gist.githubusercontent.com/Morac2/6f52e785543944b7393d88cc64bfd457/raw/8b39cd6308d750f720f7252e83e2e243d6c037be/test.yaml
Command line used for generation
java -jar openapi-generator-cli.jar generate -l java -i file.yaml -o out_dir
Steps to reproduce
Simply use openapi-generator-cli to generate code.
Related issues/PRs
N/A
Suggest a fix/enhancement
I don't have a suggested fix as I don't know why the code to grab the token isn't being created.