From b04496e4f3dfa6d07514d0ece55587aab6e812ce Mon Sep 17 00:00:00 2001 From: John Niang Date: Wed, 15 Nov 2023 11:04:09 +0800 Subject: [PATCH] Upgrade to SpringDoc 2.2.1-SNAPSHOT (#4854) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #### What type of PR is this? /kind bug /area core /milestone 2.11.x #### What this PR does / why we need it: This PR upgrades to SpringDoc 2.2.1-SNAPSHOT to resolve the problem of Swagger API doc display errors. #### Does this PR introduce a user-facing change? ```release-note 升级 SpringDoc 至 2.2.1-SNAPSHOT 以解决部分 API 文档无法正常使用的问题 ``` --- api/build.gradle | 1 + application/build.gradle | 1 + .../core/extension/attachment/endpoint/AttachmentEndpoint.java | 1 + .../run/halo/app/core/extension/endpoint/PluginEndpoint.java | 2 +- .../java/run/halo/app/core/extension/endpoint/UserEndpoint.java | 1 + .../java/run/halo/app/core/extension/theme/ThemeEndpoint.java | 2 +- .../src/main/java/run/halo/app/migration/MigrationEndpoint.java | 1 + platform/application/build.gradle | 2 +- 8 files changed, 8 insertions(+), 3 deletions(-) diff --git a/api/build.gradle b/api/build.gradle index 33f5a47ed4f..102a50883d2 100644 --- a/api/build.gradle +++ b/api/build.gradle @@ -14,6 +14,7 @@ javadoc.options.encoding = "UTF-8" repositories { mavenCentral() maven { url 'https://repo.spring.io/milestone' } + maven { url 'https://s01.oss.sonatype.org/content/repositories/snapshots' } } dependencies { diff --git a/application/build.gradle b/application/build.gradle index 0d9abe3187c..d26002f3e5d 100644 --- a/application/build.gradle +++ b/application/build.gradle @@ -24,6 +24,7 @@ repositories { mavenCentral() maven { url 'https://repo.spring.io/milestone' } + maven { url 'https://s01.oss.sonatype.org/content/repositories/snapshots' } } diff --git a/application/src/main/java/run/halo/app/core/extension/attachment/endpoint/AttachmentEndpoint.java b/application/src/main/java/run/halo/app/core/extension/attachment/endpoint/AttachmentEndpoint.java index 4274507f0f5..d8b41c0f600 100644 --- a/application/src/main/java/run/halo/app/core/extension/attachment/endpoint/AttachmentEndpoint.java +++ b/application/src/main/java/run/halo/app/core/extension/attachment/endpoint/AttachmentEndpoint.java @@ -273,6 +273,7 @@ public Comparator toComparator() { } } + @Schema(types = "object") public interface IUploadRequest { @Schema(requiredMode = REQUIRED, description = "Attachment file") diff --git a/application/src/main/java/run/halo/app/core/extension/endpoint/PluginEndpoint.java b/application/src/main/java/run/halo/app/core/extension/endpoint/PluginEndpoint.java index d6d015c1ff8..b85189765a8 100644 --- a/application/src/main/java/run/halo/app/core/extension/endpoint/PluginEndpoint.java +++ b/application/src/main/java/run/halo/app/core/extension/endpoint/PluginEndpoint.java @@ -673,7 +673,7 @@ Mono list(ServerRequest request) { .flatMap(listResult -> ServerResponse.ok().bodyValue(listResult)); } - @Schema(name = "PluginInstallRequest") + @Schema(name = "PluginInstallRequest", types = "object") public static class InstallRequest { private final MultiValueMap multipartData; diff --git a/application/src/main/java/run/halo/app/core/extension/endpoint/UserEndpoint.java b/application/src/main/java/run/halo/app/core/extension/endpoint/UserEndpoint.java index 20faeb57c01..47441a1d4da 100644 --- a/application/src/main/java/run/halo/app/core/extension/endpoint/UserEndpoint.java +++ b/application/src/main/java/run/halo/app/core/extension/endpoint/UserEndpoint.java @@ -244,6 +244,7 @@ private Mono uploadUserAvatar(ServerRequest request) { .flatMap(user -> ServerResponse.ok().bodyValue(user)); } + @Schema(types = "object") public interface IAvatarUploadRequest { @Schema(requiredMode = REQUIRED, description = "Avatar file") FilePart getFile(); diff --git a/application/src/main/java/run/halo/app/core/extension/theme/ThemeEndpoint.java b/application/src/main/java/run/halo/app/core/extension/theme/ThemeEndpoint.java index 233abad3e12..2d96a3066c8 100644 --- a/application/src/main/java/run/halo/app/core/extension/theme/ThemeEndpoint.java +++ b/application/src/main/java/run/halo/app/core/extension/theme/ThemeEndpoint.java @@ -466,7 +466,7 @@ Mono resetSettingConfig(ServerRequest request) { .bodyValue(theme)); } - @Schema(name = "ThemeInstallRequest") + @Schema(name = "ThemeInstallRequest", types = "object") public static class InstallRequest { @Schema(hidden = true) diff --git a/application/src/main/java/run/halo/app/migration/MigrationEndpoint.java b/application/src/main/java/run/halo/app/migration/MigrationEndpoint.java index 1bd43831aa2..33017defac5 100644 --- a/application/src/main/java/run/halo/app/migration/MigrationEndpoint.java +++ b/application/src/main/java/run/halo/app/migration/MigrationEndpoint.java @@ -140,6 +140,7 @@ private Flux getContent(RestoreRequest request) { .switchIfEmpty(backupFileContent); } + @Schema(types = "object") public static class RestoreRequest { private final MultiValueMap multipart; diff --git a/platform/application/build.gradle b/platform/application/build.gradle index 7275d8febb9..a3bf4f8f2dc 100644 --- a/platform/application/build.gradle +++ b/platform/application/build.gradle @@ -18,7 +18,7 @@ ext { guava = "32.0.1-jre" jsoup = '1.15.3' jsonPatch = "1.13" - springDocOpenAPI = "2.2.0" + springDocOpenAPI = "2.2.1-SNAPSHOT" lucene = "9.7.0" resilience4jVersion = "2.0.2" }