diff --git a/README.md b/README.md index dffa0360..e0dc49ac 100644 --- a/README.md +++ b/README.md @@ -169,6 +169,12 @@ methods: type: boolean isFormParameter: type: boolean + responses: + type: object + description: Includes all defined response-codes and its JSONs schema + additionalProperties: + type: object + description: See the 'Response Object' section in the [Swagger 2.0 specification](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#response-object) ``` ####Custom Mustache Variables diff --git a/lib/codegen.js b/lib/codegen.js index 1226f870..d604ce55 100644 --- a/lib/codegen.js +++ b/lib/codegen.js @@ -149,6 +149,9 @@ var getViewForSwagger2 = function(opts, type){ parameter.cardinality = parameter.required ? '' : '?'; method.parameters.push(parameter); }); + + method.responses = op.responses; + data.methods.push(method); }); });