From 321dfb73118a1ccd7c40ff3d379f86234afbf6d3 Mon Sep 17 00:00:00 2001 From: Fake Bob Dobbs Date: Mon, 4 May 2015 17:04:09 -0400 Subject: [PATCH] For SpringMVC, RequestHeader annotations are not setting the required attribute, even when required is false (RequestHeader uses default of true). This change always sets the required param --- .../src/main/resources/JavaSpringMVC/headerParams.mustache | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/swagger-codegen/src/main/resources/JavaSpringMVC/headerParams.mustache b/modules/swagger-codegen/src/main/resources/JavaSpringMVC/headerParams.mustache index dd0ea1ad4c..229717ddaa 100644 --- a/modules/swagger-codegen/src/main/resources/JavaSpringMVC/headerParams.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaSpringMVC/headerParams.mustache @@ -1 +1 @@ -{{#isHeaderParam}}@ApiParam(value = "{{{description}}}" {{#required}},required=true{{/required}} {{#allowableValues}}, allowableValues="{{{allowableValues}}}"{{/allowableValues}}{{#defaultValue}}, defaultValue="{{{defaultValue}}}"{{/defaultValue}})@RequestHeader("{{paramName}}") {{{dataType}}} {{paramName}}{{/isHeaderParam}} \ No newline at end of file +{{#isHeaderParam}}@ApiParam(value = "{{{description}}}" {{#required}},required=true{{/required}} {{#allowableValues}}, allowableValues="{{{allowableValues}}}"{{/allowableValues}}{{#defaultValue}}, defaultValue="{{{defaultValue}}}"{{/defaultValue}}) @RequestHeader(value="{{paramName}}", required={{#required}}true{{/required}}{{^required}}false{{/required}}) {{{dataType}}} {{paramName}}{{/isHeaderParam}}