mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-05-14 05:30:51 +00:00
* Allow to specify response headers (needed for redirecting clients) (#8148) Co-authored-by: Bernardo Pastorelli <13519917+randomswdev@users.noreply.github.com> * add addResponseHeaders option * enable addResponseHeaders * fix comma Co-authored-by: randomswdev <randomswdev@users.noreply.github.com> Co-authored-by: Bernardo Pastorelli <13519917+randomswdev@users.noreply.github.com>
29 lines
709 B
Go
29 lines
709 B
Go
/*
|
|
* OpenAPI Petstore
|
|
*
|
|
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
|
*
|
|
* API version: 1.0.0
|
|
* Generated by: OpenAPI Generator (https://openapi-generator.tech)
|
|
*/
|
|
|
|
package petstoreserver
|
|
|
|
//Response return a ImplResponse struct filled
|
|
func Response(code int, body interface{}) ImplResponse {
|
|
return ImplResponse {
|
|
Code: code,
|
|
Headers: nil,
|
|
Body: body,
|
|
}
|
|
}
|
|
|
|
//ResponseWithHeaders return a ImplResponse struct filled, including headers
|
|
func ResponseWithHeaders(code int, headers map[string][]string, body interface{}) ImplResponse {
|
|
return ImplResponse {
|
|
Code: code,
|
|
Headers: headers,
|
|
Body: body,
|
|
}
|
|
}
|