Title: Loading a group crashes due to roleIdsToView being null · Issue #7 · vrchatapi/vrchatapi-java · GitHub
Open Graph Title: Loading a group crashes due to roleIdsToView being null · Issue #7 · vrchatapi/vrchatapi-java
X Title: Loading a group crashes due to roleIdsToView being null · Issue #7 · vrchatapi/vrchatapi-java
Description: I am attempting to load a group with the following code: String groupId = ""; // Fill in a group ID here GroupsApi groupsApi = new GroupsApi(); Group group = groupsApi.getGroup(groupId, false); This crashes with the following exception: ...
Open Graph Description: I am attempting to load a group with the following code: String groupId = ""; // Fill in a group ID here GroupsApi groupsApi = new GroupsApi(); Group group = groupsApi.getGroup(groupId, false); Thi...
X Description: I am attempting to load a group with the following code: String groupId = ""; // Fill in a group ID here GroupsApi groupsApi = new GroupsApi(); Group group = groupsApi.getGroup(groupId, f...
Opengraph URL: https://github.com/vrchatapi/vrchatapi-java/issues/7
X: @github
Domain: patch-diff.githubusercontent.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Loading a group crashes due to roleIdsToView being null","articleBody":"I am attempting to load a group with the following code:\n\n```java\nString groupId = \"\"; // Fill in a group ID here\nGroupsApi groupsApi = new GroupsApi();\nGroup group = groupsApi.getGroup(groupId, false);\n```\n\nThis crashes with the following exception:\n```\nError: Expected the field `roleIdsToView` to be an array in the JSON string but got `null`\njava.lang.IllegalArgumentException: Expected the field `roleIdsToView` to be an array in the JSON string but got `null`\n\tat io.github.vrchatapi.model.GroupGallery.validateJsonObject(GroupGallery.java:481)\n\tat io.github.vrchatapi.model.Group.validateJsonObject(Group.java:1218)\n\tat io.github.vrchatapi.model.Group$CustomTypeAdapterFactory$1.read(Group.java:1263)\n\tat io.github.vrchatapi.model.Group$CustomTypeAdapterFactory$1.read(Group.java:1253)\n\tat com.google.gson.TypeAdapter$1.read(TypeAdapter.java:308)\n\tat com.google.gson.Gson.fromJson(Gson.java:1361)\n\tat com.google.gson.Gson.fromJson(Gson.java:1262)\n\tat com.google.gson.Gson.fromJson(Gson.java:1171)\n\tat com.google.gson.Gson.fromJson(Gson.java:1137)\n\tat io.github.vrchatapi.JSON.deserialize(JSON.java:340)\n\tat io.github.vrchatapi.ApiClient.deserialize(ApiClient.java:851)\n\tat io.github.vrchatapi.ApiClient.handleResponse(ApiClient.java:1061)\n\tat io.github.vrchatapi.ApiClient.execute(ApiClient.java:985)\n\tat io.github.vrchatapi.api.GroupsApi.getGroupWithHttpInfo(GroupsApi.java:2606)\n\tat io.github.vrchatapi.api.GroupsApi.getGroup(GroupsApi.java:2584)\n```\n\nLooking into this, it does appear that that field is marked as nullable in the specification: https://github.com/vrchatapi/specification/blob/main/openapi/components/schemas/GroupGallery.yaml#L21\n\nand the raw response from the server looks like this:\n```json\n{\n\"roleIdsToView\": null,\n}\n```\n\nInspecting the generated code and setting a breakpoint leads me to this generated code snippet:\n```java\n // ensure the optional json data is an array if present\n if (jsonObj.get(\"roleIdsToView\") != null \u0026\u0026 !jsonObj.get(\"roleIdsToView\").isJsonArray()) {\n throw new IllegalArgumentException(String.format(\"Expected the field `roleIdsToView` to be an array in the JSON string but got `%s`\", jsonObj.get(\"roleIdsToView\").toString()));\n }\n```\n\nSetting a breakpoint on the throw line reveals that jsonObj.get(\"roleIdsToView\") is not set to null, but to JsonNull:\n\u003cimg width=\"1469\" height=\"651\" alt=\"Image\" src=\"https://github.com/user-attachments/assets/f98f9324-dc35-4ad4-a8a5-beaeae51555a\" /\u003e\n\ncausing the check for null to fail and the code to crash. I'm assuming this would affect other nullable fields as well; is there a flag or something that needs to be changed with the codegen to fix this?","author":{"url":"https://github.com/unshowered","@type":"Person","name":"unshowered"},"datePublished":"2025-09-03T04:29:55.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/7/vrchatapi-java/issues/7"}
| 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:697d2c54-9544-18b7-0f36-abc8a86f5db6 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 80AA:82740:1CF0849:26E0C57:697AABBF |
| html-safe-nonce | 2901d1b5846326b88f695fe1ce2fd1bf96c04053aaa053272dd3ab96b7a49919 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4MEFBOjgyNzQwOjFDRjA4NDk6MjZFMEM1Nzo2OTdBQUJCRiIsInZpc2l0b3JfaWQiOiI2NTExNzQ1ODAyMDk0NDIyOTc1IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 662ebed99ba67818bb7728978707583a630828efa91d2e6923c501d706153bde |
| hovercard-subject-tag | issue:3378257914 |
| 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/vrchatapi/vrchatapi-java/7/issue_layout |
| twitter:image | https://opengraph.githubassets.com/0832b3ca586d490caddbc2996e8b6dffe325d912d71f85f46e5b6f390897fda9/vrchatapi/vrchatapi-java/issues/7 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/0832b3ca586d490caddbc2996e8b6dffe325d912d71f85f46e5b6f390897fda9/vrchatapi/vrchatapi-java/issues/7 |
| og:image:alt | I am attempting to load a group with the following code: String groupId = ""; // Fill in a group ID here GroupsApi groupsApi = new GroupsApi(); Group group = groupsApi.getGroup(groupId, false); Thi... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | unshowered |
| hostname | github.com |
| expected-hostname | github.com |
| None | 4d375b6c612de26fd037e0638eaf57e32cf9b16daf53ab68c25c04cd3b058113 |
| turbo-cache-control | no-preview |
| go-import | github.com/vrchatapi/vrchatapi-java git https://github.com/vrchatapi/vrchatapi-java.git |
| octolytics-dimension-user_id | 36933130 |
| octolytics-dimension-user_login | vrchatapi |
| octolytics-dimension-repository_id | 398903273 |
| octolytics-dimension-repository_nwo | vrchatapi/vrchatapi-java |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 398903273 |
| octolytics-dimension-repository_network_root_nwo | vrchatapi/vrchatapi-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 | 5b310e2c1221fb24ffd3f38a097000863d2dfdd4 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width