You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hugegraph.apache.org by ji...@apache.org on 2022/05/18 09:40:01 UTC

[incubator-hugegraph] branch master updated: chore: replace `APPLICATION_JSON` with `TEXT_PLAIN` in dynamic create graph api (#1888)

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

jin pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-hugegraph.git


The following commit(s) were added to refs/heads/master by this push:
     new 88d71e75b chore: replace `APPLICATION_JSON` with `TEXT_PLAIN` in dynamic create graph api (#1888)
88d71e75b is described below

commit 88d71e75b163fd0c1b700d694d0dd5768058905c
Author: Simon Cheung <mi...@apache.org>
AuthorDate: Wed May 18 17:39:55 2022 +0800

    chore: replace `APPLICATION_JSON` with `TEXT_PLAIN` in dynamic create graph api (#1888)
---
 hugegraph-api/src/main/java/com/baidu/hugegraph/api/API.java           | 1 +
 .../src/main/java/com/baidu/hugegraph/api/profile/GraphsAPI.java       | 3 +--
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/hugegraph-api/src/main/java/com/baidu/hugegraph/api/API.java b/hugegraph-api/src/main/java/com/baidu/hugegraph/api/API.java
index 352c4e87f..bfd0c71b8 100644
--- a/hugegraph-api/src/main/java/com/baidu/hugegraph/api/API.java
+++ b/hugegraph-api/src/main/java/com/baidu/hugegraph/api/API.java
@@ -49,6 +49,7 @@ public class API {
 
     public static final String CHARSET = "UTF-8";
 
+    public static final String TEXT_PLAIN = MediaType.TEXT_PLAIN;
     public static final String APPLICATION_JSON = MediaType.APPLICATION_JSON;
     public static final String APPLICATION_JSON_WITH_CHARSET =
                                APPLICATION_JSON + ";charset=" + CHARSET;
diff --git a/hugegraph-api/src/main/java/com/baidu/hugegraph/api/profile/GraphsAPI.java b/hugegraph-api/src/main/java/com/baidu/hugegraph/api/profile/GraphsAPI.java
index 08706610d..ade85b71c 100644
--- a/hugegraph-api/src/main/java/com/baidu/hugegraph/api/profile/GraphsAPI.java
+++ b/hugegraph-api/src/main/java/com/baidu/hugegraph/api/profile/GraphsAPI.java
@@ -24,7 +24,6 @@ import java.util.HashSet;
 import java.util.Map;
 import java.util.Set;
 
-import io.swagger.annotations.Api;
 import io.swagger.v3.oas.annotations.tags.Tag;
 import jakarta.annotation.security.RolesAllowed;
 import jakarta.inject.Singleton;
@@ -124,7 +123,7 @@ public class GraphsAPI extends API {
     @POST
     @Timed
     @Path("{name}")
-    @Consumes(APPLICATION_JSON_WITH_CHARSET)
+    @Consumes(TEXT_PLAIN)
     @Produces(APPLICATION_JSON_WITH_CHARSET)
     @RolesAllowed({"admin"})
     public Object create(@Context GraphManager manager,