connexion
connexion copied to clipboard
Mock server doesn't respond with headers
Description
When running in mock server mode with an OpenAPI 3 API definition, response headers aren't returned.
Expected behaviour
Headers defined in responses
section should be included in response.
Actual behaviour
Only a few standard headers like Content-Type
and Content-Length
are included.
Steps to reproduce
- Add any header to an OpenAPI 3 response definition. Something like:
/Endpoint:
get:
responses:
'200':
headers:
cache-control:
schema:
type: string
example: public
content:
application/json:
...
- Start connexion with
connexion run your_api.yaml --mock=all
- Request the endpoint with an HTTP client, such as
curl -v
- Observe that the header is not included in the response.
Additional info:
Output of the commands:
-
python --version
Python 2.7.15rc1 -
pip show connexion | grep "^Version\:"
Version: 2.2.0
I see you added the enhancement tag to this issue. I'd be happy to look at putting together a pull request if you can point me in right direction. I haven't dug into this codebase before.
Hi @alangibson-philips ,
I'm happy to hear you would be willing to send a PR. What kind of direction are you looking for? How could I help you?