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

MessagePack profiles #101

Open
epoberezkin opened this issue Jan 28, 2024 · 3 comments
Open

MessagePack profiles #101

epoberezkin opened this issue Jan 28, 2024 · 3 comments

Comments

@epoberezkin
Copy link

The spec defines the encoding profiles, e.g. prohibit binary (we don't need it, binary support is our main motivation to consider moving to MessagePack), or restrict key types to strings (this is actually something we need).

Any view on how it could be added?

@iphydf
Copy link
Member

iphydf commented Jan 29, 2024

Interesting. I haven't thought about that yet, I'll think about it. Do you have suggestions?

@epoberezkin
Copy link
Author

There are two options here: either add config to type class, like Aeson does, or add it to decode function.

Given that type classes are unlikely to re-define basic objects and map encodings, the latter is probably better - we could add a version of decoding function that accepts options.

@iphydf
Copy link
Member

iphydf commented Jan 29, 2024

Since decode always goes through the data type (unlike aeson, which can do direct decoding from byte arrays without going through the object model), maybe we can have a profile validation operating on the object model?

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

2 participants