We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
This code is impossible to deserialize:
@Serializable data class EditPromoCodeRequest( val code: String? = null, val owner: UserQuery? = null, ) @Serializable sealed interface UserQuery { @Serializable @SerialName("id") @JvmInline value class Id(val id: UUID) : UserQuery @Serializable @SerialName("email") @JvmInline value class Email(val email: String) : UserQuery }
When a json object is sent, the serialization fails with :
Illegal input: Unexpected JSON token at offset 54: Expected beginning of the string, but got { at path: $.owner
When a string is sent, the request fails with:
Illegal input: Expected JsonObject, but had JsonLiteral as the serialized body of UserQuery at element: $.owner
Example of a correct body:
{ "owner": { "type": "email", "email": "[email protected]" } }
Environment
The text was updated successfully, but these errors were encountered:
I think this is the same issue as #2839
Sorry, something went wrong.
For context: #2049 (comment)
Perhaps there should be special mode for value classes in this case
No branches or pull requests
This code is impossible to deserialize:
When a json object is sent, the serialization fails with :
When a string is sent, the request fails with:
Example of a correct body:
Environment
The text was updated successfully, but these errors were encountered: