fix(client): update Content-Type in GraphsAPI for adding graphs#714
Merged
imbajin merged 5 commits intoapache:masterfrom Apr 19, 2026
Merged
fix(client): update Content-Type in GraphsAPI for adding graphs#714imbajin merged 5 commits intoapache:masterfrom
imbajin merged 5 commits intoapache:masterfrom
Conversation
修正Graphs 的 create 接口中 Content-Type 定义错误的问题,改为application/json
Closed
1 task
imbajin
reviewed
Feb 24, 2026
| public Map<String, String> create(String name, String cloneGraphName, String configText) { | ||
| this.client.checkApiVersion("0.67", "dynamic graph add"); | ||
| RestHeaders headers = new RestHeaders().add(RestHeaders.CONTENT_TYPE, "text/plain"); | ||
| RestHeaders headers = new RestHeaders().add(RestHeaders.CONTENT_TYPE, "application/json"); |
Member
There was a problem hiding this comment.
Maybe we need to add a test for it to ensure it won't be broken in the future
- Use RestHeaders.APPLICATION_JSON constant in GraphsAPI.create() - Bump hugegraph-common version from 1.5.0 to 1.7.0 - Add unit tests (Mockito) to verify Content-Type and clone params - Re-enable integration tests (server NPE fixed in hugegraph#2900) - Migrate test config files from .properties to JSON format - Remove outdated assertEquals on response size (server now returns 4 fields)
- Delete orphaned .properties test config files (replaced by .json) - Remove unused VersionUtil import in GraphsAPITest
…lization
hugegraph-common 1.7.0 added MAPPER.disable(WRITE_DATES_AS_TIMESTAMPS)
with SimpleDateFormat, so Date values are now serialized as String
("yyyy-MM-dd HH:mm:ss.SSS") instead of Long (epoch millis).
This causes the server's UpdateStrategy.formatError() to report
"Date, String" instead of "Date, Long" when checking INTERSECTION
strategy on non-collection properties.
imbajin
approved these changes
Apr 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fix #713
Fix the error in the Content-Type definition in the create interface of Graphs, and change it to application/json.