Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

For null properties, use JsonNode/JsonElement instead of Any #401

Open
jmfayard opened this issue Aug 11, 2022 · 1 comment
Open

For null properties, use JsonNode/JsonElement instead of Any #401

jmfayard opened this issue Aug 11, 2022 · 1 comment

Comments

@jmfayard
Copy link

jmfayard commented Aug 11, 2022

Bonjour,

your plugin is fantastic, what a waste of time it seems now to have written the data classes manually!

I have a request:

If my json contains a null like

{
"started_at": "sdfqsdds",
"closed_at" : null
}

the plugin is currently translating to the Any? type, which gives me a runtime/compile error (don't remember).

I would rather have those types being used, depending on my serialization library:

val jackson: com.fasterxml.jackson.databind.JsonNode? = TODO()
val kotlinx : kotlinx.serialization.json.JsonElement? = TODO()
@wuseal
Copy link
Owner

wuseal commented Aug 13, 2022

Good advice! Will fix it next version,thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants