Closed dlamblin closed 7 years ago
I'm not very familiar with Github issues, can I label this "Client: Python" and "Issue: Bug"?
@dlamblin sorry you don't have right to do that and I've just labeled it for you.
I've replied in SO: http://stackoverflow.com/a/41455961/677735. Please take a look.
@wing328 So… the api authors gave two different production end points for the api, and it turns out only one works and they differ by a letter. It was a matter of sticking to the one that works. Therefore, it's not a bug in codegen. It would be helpful to have some troubleshooting documentation and a little bit about how to debug these, but then the project covers so many languages and environments that I understand that things are kept brief.
@dlamblin would the debug switch help: https://github.com/swagger-api/swagger-codegen/blob/master/samples/client/petstore/python/petstore_api/configuration.py#L80 ?
I agree the documentation can be further improved and we can add a new section to the auto-generated README.md on how to use the debug-related setting in configuration.py.
(If you like Swagger Codegen, please upvote our ProductHunt page)
@dlamblin the debug switch should print out the header and body of HTTP requests and responses.
Please let us know how it can be further improved to address the problem you encountered.
Description
I've generated a python client for an api that uses in-header tokens for authentication. You can see a write up of the minimalized version of the issue at: http://stackoverflow.com/questions/41291995/the-specifics-of-adding-a-header-to-an-api-call-with-a-swagger-codegen-client-in
Swagger-codegen version
The version hosted at editor.swagger.io on 2016-12-20 (to 22)
Swagger declaration file content or url
Command line used for generation
Used the editor's codegen However the API seems to work with the token when I use
curl
with-H 'X-CAG-Authorization: AG_CONSUMER_TOKEN access-key=31337-70k3n'
Steps to reproduce
See the http://stackoverflow.com/questions/41291995/the-specifics-of-adding-a-header-to-an-api-call-with-a-swagger-codegen-client-in
Related issues
Unknown.
Suggest a Fix
Documentation showing an end to end use of an api key AND documentation showing how to debug or log exactly what is requested (headers).