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

Request for Codec.Create with Format of byte [] #53

Closed
fluxlife opened this issue Jul 10, 2020 · 2 comments
Closed

Request for Codec.Create with Format of byte [] #53

fluxlife opened this issue Jul 10, 2020 · 2 comments

Comments

@fluxlife
Copy link

I may be misunderstanding this but if you wanted to supply your own custom FsCodec to Equinox you can FsCodec.Codec.Create(encoder, decoder). However, Equinox expects a a 'Format of byte[] ... i.e. IEventCodec<'Event,byte [], 'Context> but it seems that FsCodec.Codec.Create will only allow you to construct a IEventCodec<'Event, string, 'Context>. Notice string vs byte [].

I am sure the work around is to fully implement IEventCodec, but would be nice to have a equinox compatible short hand constructor.

@bartelink
Copy link
Collaborator

https://github.com/jet/FsCodec/blob/master/src/FsCodec.SystemTextJson/Interop.fs#L51 does the requisite mapping

Lets leave this ticket open until someone gets around to planting a mention of it in the README.md (arguably it should go in Equinox's DOCUMENTATION.md) ;)

@bartelink
Copy link
Collaborator

I'm now unclear on the ask to be honest (i.e. not sure my suggestion above makes any sense relative to your need).

Feel free to re-open with more details if it's still a desire for you.

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