gson really doesn't like my class, does anyone know why?
its only calling .toString() on it instead of convering it to json it can parse back into an object. Class is attached.
7 Replies
⌛
This post has been reserved for your question.
Hey @blockgoblin31! Please useTIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here./close
or theClose Post
button above when your problem is solved. Please remember to follow the help guidelines. This post will be automatically closed after 300 minutes of inactivity.
after walking through in debugger this line is causing the problem https://github.com/google/gson/blob/main/gson/src/main/java/com/google/gson/internal/bind/MapTypeAdapterFactory.java#L218, I just need to figure out how to get it to have true for that boolean
might be set from this https://github.com/google/gson/blob/main/gson/src/main/java/com/google/gson/Gson.java#L159
found the solution, I needed to run .enableComplexMapKeySerialization() on the GsonBuilder before getting a Gson from it
Post Closed
This post has been closed by <@501514065068294154>.