I am trying to generate a client using swagger codegen for a REST Api having OAuth 2.0 security. The call is following:
E:\>java -jar swagger-codegen-distribution-2.1.2-M1.jar -a access_token:df8eb092-e34f-48f9-b4ce-32cdd1ae2613 -i http://localhost:8080/someapi/api-docs -l java -o E:\projects\prototypes\ApiClient
But this call is not working and generating the following output as:
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
reading from http://localhost:8080/someapi/api-docs
reading from http://localhost:8080/someapi/api-docs
usage: Codegen
-a,--auth addes authorization headers when fetching the
swagger definitions remotely. Pass in a
URL-encoded string of name:header with a comma
separating multiple values
-d,--debug-info prints additional info for debugging
-h,--help shows this message
-i,--input-spec <arg> location of the swagger spec, as URL or file
-l,--lang <arg> client language to generate.
Available languages include:
[android, async-scala, java, jaxrs, nodejs,
objc, scalatra, scala, dynamic-html, html,
swagger, tizen, php, python]
-o,--output <arg> where to write the generated files
-t,--template-dir <arg> folder containing the template files
I have implemented recently the OAuth2.0 for this API so I assume that there is some problem with the authentication header I am setting with this APi as earlier the codegen was working well.
The following combinations I have tried for the -a option in the above command:
-a access_token:<token>
-a "access_token":<token>
-a name:AUTHORIZATION,<token>
But nothing is working. I am really in trouble with a demo today. Really appreciate any quick help
Thanks