Title: JsonObject deserialisation · Issue #883 · msgpack/msgpack-java · GitHub
Open Graph Title: JsonObject deserialisation · Issue #883 · msgpack/msgpack-java
X Title: JsonObject deserialisation · Issue #883 · msgpack/msgpack-java
Description: I am using JsonReader to read json bytes to JsonObject. What is the equivalent for msgpack? Below is the code we are using for desrialising json to JsonObject. JsonReader jsonReader = Json.createReader(content); object = jsonReader.readO...
Open Graph Description: I am using JsonReader to read json bytes to JsonObject. What is the equivalent for msgpack? Below is the code we are using for desrialising json to JsonObject. JsonReader jsonReader = Json.createRe...
X Description: I am using JsonReader to read json bytes to JsonObject. What is the equivalent for msgpack? Below is the code we are using for desrialising json to JsonObject. JsonReader jsonReader = Json.createRe...
Opengraph URL: https://github.com/msgpack/msgpack-java/issues/883
X: @github
Domain: patch-diff.githubusercontent.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"JsonObject deserialisation","articleBody":"I am using JsonReader to read json bytes to JsonObject. What is the equivalent for msgpack?\nBelow is the code we are using for desrialising json to JsonObject.\n```\nJsonReader jsonReader = Json.createReader(content);\n object = jsonReader.readObject();\n jsonReader.close();\n```\n\nFor deserialising JsonObject msgpack bytes to JsonObject in java, I have tried ObjectMapper, but it fails with \n\n```com.fasterxml.jackson.databind.exc.InvalidDefinitionException: Cannot find a deserializer for non-concrete Map type [map type; class jakarta.json.JsonObject, [simple type, class java.lang.String] -\u003e [simple type, class jakarta.json.JsonValue]]```\n\nBelow is the sample i have tried, which produces above error. What is the right way to deserialise a JsonObject in msgpack? \n\n```\nString nodeInfo = \"{\\n\" +\n \"\\t\\\"nodeType\\\": \\\"directory\\\"\\n\" +\n \"}\";\n \n // Create JsonObject from nodeInfo string\n JsonObject node;\n try (jakarta.json.JsonReader jsonReader = jakarta.json.Json.createReader(new ByteArrayInputStream(nodeInfo.getBytes(StandardCharsets.UTF_8)))) {\n node = jsonReader.readObject();\n }\n\n // Create MessagePack data\n ObjectMapper msgpackMapper = new ObjectMapper(new MessagePackFactory());\n byte[] bytes = msgpackMapper.writeValueAsBytes(node);\n```\n\nFrom https://github.com/msgpack/msgpack-java/issues/465#issuecomment-1695827215, it looks like with ObjectMapper, JsonObject deserialisation used to work before. But it does not work now. Could you please suggest a solution?\n\nVersions used: \njackson version - 2.15.3\nmsgpack version - 0.9.7","author":{"url":"https://github.com/ashj11","@type":"Person","name":"ashj11"},"datePublished":"2025-04-02T08:55:34.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":2},"url":"https://github.com/883/msgpack-java/issues/883"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:91b2f2e8-a5ce-ee68-65b0-a48ca963b42d |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | DB80:1587BA:48C27A5:5F2CA76:696D2504 |
| html-safe-nonce | d630b9c113da5da1d0f3f4b362c8027a870922ca6c562480aa01aca5390624fc |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEQjgwOjE1ODdCQTo0OEMyN0E1OjVGMkNBNzY6Njk2RDI1MDQiLCJ2aXNpdG9yX2lkIjoiMzQ2OTUxMTc5MzgxMzE4OTE2IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 047aa95d59a91e7cb4bfc15f752c385472fad78c4bed7b6d221621af4fa7c229 |
| hovercard-subject-tag | issue:2965685395 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/msgpack/msgpack-java/883/issue_layout |
| twitter:image | https://opengraph.githubassets.com/2fd7018c72a7d77cf006ed063717f3036084d8bf2b0a8ca108f6f19928c5b171/msgpack/msgpack-java/issues/883 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/2fd7018c72a7d77cf006ed063717f3036084d8bf2b0a8ca108f6f19928c5b171/msgpack/msgpack-java/issues/883 |
| og:image:alt | I am using JsonReader to read json bytes to JsonObject. What is the equivalent for msgpack? Below is the code we are using for desrialising json to JsonObject. JsonReader jsonReader = Json.createRe... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | ashj11 |
| hostname | github.com |
| expected-hostname | github.com |
| None | 0944e430045f4fb5f7bd103e0660080acfe593174063212555773ca41c144a14 |
| turbo-cache-control | no-preview |
| go-import | github.com/msgpack/msgpack-java git https://github.com/msgpack/msgpack-java.git |
| octolytics-dimension-user_id | 198264 |
| octolytics-dimension-user_login | msgpack |
| octolytics-dimension-repository_id | 1971346 |
| octolytics-dimension-repository_nwo | msgpack/msgpack-java |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 1971346 |
| octolytics-dimension-repository_network_root_nwo | msgpack/msgpack-java |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 66b6e773801d28660016072069017cfcc851f54b |
| ui-target | canary-1 |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width