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

KotlinX.Serialization interop #16

Open
CLOVIS-AI opened this issue May 20, 2023 · 0 comments
Open

KotlinX.Serialization interop #16

CLOVIS-AI opened this issue May 20, 2023 · 0 comments

Comments

@CLOVIS-AI
Copy link

KotlinX.Serialization has a great serialization story with regular Kotlin:

@Serializable
class Foo(
    val username: String,
) {
    init {
        ensure(' ' !in username) { "The username cannot contain whitespace" }
    }
}

If we follow the same approach of "just annotate it with @Serializable", with our current design, it will be possible to deserialize values that are not valid.

I don't really see a good way to do this at the moment, I'm interested if you have any ideas.

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

No branches or pull requests

1 participant