From 171151f91edaba65c6a34f9e926a8dc316450e9c Mon Sep 17 00:00:00 2001 From: Gabriel Bauman Date: Wed, 21 Jun 2017 12:24:23 -0700 Subject: [PATCH] Make interface default methods return Not Implemented When using JDK8 and generating default interface method implementations, return HTTP 501 Not Implemented rather than 200 OK by default. (#5895) --- .../swagger-codegen/src/main/resources/JavaSpring/api.mustache | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/swagger-codegen/src/main/resources/JavaSpring/api.mustache b/modules/swagger-codegen/src/main/resources/JavaSpring/api.mustache index bcdd35ecf1d..98673d46aa8 100644 --- a/modules/swagger-codegen/src/main/resources/JavaSpring/api.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaSpring/api.mustache @@ -56,7 +56,7 @@ public interface {{classname}} { method = RequestMethod.{{httpMethod}}) {{#jdk8}}default {{/jdk8}}{{#responseWrapper}}{{.}}<{{/responseWrapper}}ResponseEntity<{{>returnTypes}}>{{#responseWrapper}}>{{/responseWrapper}} {{operationId}}({{#allParams}}{{>queryParams}}{{>pathParams}}{{>headerParams}}{{>bodyParams}}{{>formParams}}{{#hasMore}},{{/hasMore}}{{/allParams}}){{^jdk8}};{{/jdk8}}{{#jdk8}} { // do some magic! - return {{#async}}CompletableFuture.completedFuture({{/async}}new ResponseEntity<{{>returnTypes}}>(HttpStatus.OK){{#async}}){{/async}}; + return {{#async}}CompletableFuture.completedFuture({{/async}}new ResponseEntity<{{>returnTypes}}>(HttpStatus.NOT_IMPLEMENTED){{#async}}){{/async}}; }{{/jdk8}} {{/operation}}