JAVA-2399 Update spring-security-rest module to use Swagger 3.0.0

This commit is contained in:
mikr 2021-05-14 18:01:30 +02:00
parent b4513058be
commit 18695338b1
2 changed files with 9 additions and 11 deletions

View File

@ -275,7 +275,7 @@
<rest-assured.version>2.9.0</rest-assured.version>
<!-- swagger -->
<springfox-swagger.version>2.9.2</springfox-swagger.version>
<springfox-swagger.version>3.0.0</springfox-swagger.version>
<!-- Maven plugins -->
<cargo-maven2-plugin.version>1.6.1</cargo-maven2-plugin.version>

View File

@ -6,12 +6,11 @@ import java.util.Collections;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.http.HttpMethod;
import springfox.documentation.builders.PathSelectors;
import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.builders.ResponseMessageBuilder;
import springfox.documentation.schema.ModelRef;
import springfox.documentation.builders.ResponseBuilder;
import springfox.documentation.service.ApiInfo;
import springfox.documentation.service.Contact;
import springfox.documentation.spi.DocumentationType;
@ -30,13 +29,12 @@ public class SwaggerConfig {
.build()
.apiInfo(apiInfo())
.useDefaultResponseMessages(false)
.globalResponseMessage(RequestMethod.GET, newArrayList(new ResponseMessageBuilder().code(500)
.message("500 message")
.responseModel(new ModelRef("Error"))
.build(),
new ResponseMessageBuilder().code(403)
.message("Forbidden!!!!!")
.build()));
.globalResponses(HttpMethod.GET, newArrayList(
new ResponseBuilder().code("500")
.description("500 message").build(),
new ResponseBuilder().code("403")
.description("Forbidden!!!!!").build()
));
}
private ApiInfo apiInfo() {