From 85824486a5c992196464a39767429784af9a6b98 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=98=BF=E7=94=B7?= Date: Tue, 12 Nov 2024 03:29:00 +0800 Subject: [PATCH] add `springdoc-openapi-starter-webmvc-ui` --- .../pom.xml | 14 ++++++++++---- .../main/java/com/sample/app/HelloResource.java | 4 ++-- .../src/main/java/com/sample/app/RestApp.java | 6 +++--- 3 files changed, 15 insertions(+), 9 deletions(-) diff --git a/servlet/resteasy-wildfly-spring-boot-sample-app/pom.xml b/servlet/resteasy-wildfly-spring-boot-sample-app/pom.xml index 383b652..40937cb 100644 --- a/servlet/resteasy-wildfly-spring-boot-sample-app/pom.xml +++ b/servlet/resteasy-wildfly-spring-boot-sample-app/pom.xml @@ -88,11 +88,17 @@ spring-boot-starter-actuator + + + + + + + - org.eclipse.microprofile.openapi - microprofile-openapi-api - ${version.eclipse.microprofile.openapi} - provided + org.springdoc + springdoc-openapi-starter-webmvc-ui + 2.6.0 diff --git a/servlet/resteasy-wildfly-spring-boot-sample-app/src/main/java/com/sample/app/HelloResource.java b/servlet/resteasy-wildfly-spring-boot-sample-app/src/main/java/com/sample/app/HelloResource.java index 35e0a4b..c730fbb 100644 --- a/servlet/resteasy-wildfly-spring-boot-sample-app/src/main/java/com/sample/app/HelloResource.java +++ b/servlet/resteasy-wildfly-spring-boot-sample-app/src/main/java/com/sample/app/HelloResource.java @@ -1,6 +1,6 @@ package com.sample.app; -import org.eclipse.microprofile.openapi.annotations.responses.APIResponse; +//import org.eclipse.microprofile.openapi.annotations.responses.APIResponse; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; @@ -14,7 +14,7 @@ public class HelloResource { @Autowired EchoBean bean; - @APIResponse(description = "return hello world") +// @APIResponse(description = "return hello world") @GET public String get() { return bean.echo("Hello, world!"); diff --git a/servlet/resteasy-wildfly-spring-boot-sample-app/src/main/java/com/sample/app/RestApp.java b/servlet/resteasy-wildfly-spring-boot-sample-app/src/main/java/com/sample/app/RestApp.java index 0a02692..17c1691 100644 --- a/servlet/resteasy-wildfly-spring-boot-sample-app/src/main/java/com/sample/app/RestApp.java +++ b/servlet/resteasy-wildfly-spring-boot-sample-app/src/main/java/com/sample/app/RestApp.java @@ -2,10 +2,10 @@ import jakarta.ws.rs.ApplicationPath; import jakarta.ws.rs.core.Application; -import org.eclipse.microprofile.openapi.annotations.OpenAPIDefinition; -import org.eclipse.microprofile.openapi.annotations.info.Info; +//import org.eclipse.microprofile.openapi.annotations.OpenAPIDefinition; +//import org.eclipse.microprofile.openapi.annotations.info.Info; @ApplicationPath("/rest") -@OpenAPIDefinition(info = @Info(title = "RestApp", version = "1.0.0")) +//@OpenAPIDefinition(info = @Info(title = "RestApp", version = "1.0.0")) public class RestApp extends Application { }