You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@inlong.apache.org by he...@apache.org on 2022/06/28 02:05:57 UTC

[inlong] branch master updated: [INLONG-4755][Manager] Resolve Swagger display LocalDate-related format issues (#4789)

This is an automated email from the ASF dual-hosted git repository.

healchow pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/inlong.git


The following commit(s) were added to refs/heads/master by this push:
     new 93a816b48 [INLONG-4755][Manager] Resolve Swagger display LocalDate-related format issues (#4789)
93a816b48 is described below

commit 93a816b487644510e4c1c065efde60762d8e96be
Author: lanyxp <yu...@163.com>
AuthorDate: Tue Jun 28 10:05:51 2022 +0800

    [INLONG-4755][Manager] Resolve Swagger display LocalDate-related format issues (#4789)
---
 .../java/org/apache/inlong/manager/web/config/Swagger2Config.java  | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/inlong-manager/manager-web/src/main/java/org/apache/inlong/manager/web/config/Swagger2Config.java b/inlong-manager/manager-web/src/main/java/org/apache/inlong/manager/web/config/Swagger2Config.java
index a5902b5fc..c278cba10 100644
--- a/inlong-manager/manager-web/src/main/java/org/apache/inlong/manager/web/config/Swagger2Config.java
+++ b/inlong-manager/manager-web/src/main/java/org/apache/inlong/manager/web/config/Swagger2Config.java
@@ -27,6 +27,10 @@ import springfox.documentation.spi.DocumentationType;
 import springfox.documentation.spring.web.plugins.Docket;
 import springfox.documentation.swagger2.annotations.EnableSwagger2;
 
+import java.time.LocalDate;
+import java.time.LocalDateTime;
+import java.time.LocalTime;
+
 /**
  * Swagger2 API Configuration
  */
@@ -38,6 +42,9 @@ public class Swagger2Config {
     public Docket createRestApi() {
         return new Docket(DocumentationType.SWAGGER_2)
                 .apiInfo(apiInfo())
+                .directModelSubstitute(LocalDate.class, String.class)
+                .directModelSubstitute(LocalDateTime.class, String.class)
+                .directModelSubstitute(LocalTime.class, String.class)
                 .select()
                 .apis(RequestHandlerSelectors.basePackage("org.apache.inlong.manager.web"))
                 .paths(PathSelectors.any())