swagger-codegen
swagger-codegen copied to clipboard
feat(nodejs): add support for response headers
PR checklist
- [x] Read the contribution guidelines.
- [x] Ran the shell script under
./bin/to update Petstore sample so that CIs can verify the change. (For instance, only need to run./bin/{LANG}-petstore.shand./bin/security/{LANG}-petstore.shif updating the {LANG} (e.g. php, ruby, python, etc) code generator or {LANG} client's mustache templates). Windows batch files can be found in.\bin\windows\. - [x] Filed the PR against the correct branch: master for non-breaking changes and
3.0.0branch for breaking (non-backward compatible) changes.
Description of the PR
Response headers defined in swagger file are returned by the nodejs server.
Closes #6424
Tested with the following yaml:
swagger: '2.0'
info:
description: >-
This is a sample server Petstore server. You can find out more about
Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net,
#swagger](http://swagger.io/irc/). For this sample, you can use the api
key `special-key` to test the authorization filters.
version: 1.0.0
title: Swagger Petstore
termsOfService: 'http://swagger.io/terms/'
contact:
email: [email protected]
license:
name: Apache 2.0
url: 'http://www.apache.org/licenses/LICENSE-2.0.html'
host: petstore.swagger.io
basePath: /v2
tags:
- name: pet
description: Everything about your Pets
externalDocs:
description: Find out more
url: 'http://swagger.io'
schemes:
- http
paths:
/pet/responsewithheader:
get:
tags:
- pet
produces:
- application/xml
- application/json
responses:
'200':
headers:
MyHeader:
type: string
default: '*'
description: successful operation
/pet/response:
get:
tags:
- pet
produces:
- application/xml
- application/json
responses:
'200':
description: successful operation
To test, the generated service has to be moved manually to service folder. (See #6443)
@sandro97git sorry I've been pretty busy this week. I'll review this week and answer your questions.
Any news here? No problem if you're busy, just in case you forgot :smiley:
Any news here? No problem if you're busy, just in case you forgot 😃
Sorry for the delay. Let me review this weekend and get back to you