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: redirect.github.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:6bf817d0-7d4b-8407-1089-5ccf01de94ba |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A60A:14F0B0:12A9954:1925463:6A534441 |
| html-safe-nonce | 08ab5b3bb70495d0b90f6b8eb8730dacc258bb70be927ab793faf88238822122 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBNjBBOjE0RjBCMDoxMkE5OTU0OjE5MjU0NjM6NkE1MzQ0NDEiLCJ2aXNpdG9yX2lkIjoiNDE0NDUzOTU3NzIyOTcyMjY4OSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 3cd941a738d7a9b53b4abbbdb5e05950e279a89ecd867c7e522ba5ef5a6d660a |
| 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 | b9a586c06a05a7a86fc7e3f4dbd03e42f6869085879aa184aa6369456dbd50fb |
| 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 | 07a982c1d40157c619b364352b704c3ce66bb332 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width