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

Json Serialization #11

Closed
AngelMunoz opened this issue Apr 19, 2020 · 3 comments
Closed

Json Serialization #11

AngelMunoz opened this issue Apr 19, 2020 · 3 comments
Assignees
Labels
documentation Improvements or additions to documentation

Comments

@AngelMunoz
Copy link
Contributor

Hey, I just discovered Falco and it looks pretty neat! I'll try to give it a run on the following days

I just have a question about JSON serialization/deserialization I saw that you are using the System.Text.Json API's

I believe I tried those previously in another project but ran into exceptions once I tried to deserialize option types as well as Discriminated Unions, with that in mind

Is it safe to just deserialize json?

if not, you might want to consider taking a look at
https://github.com/Tarmil/FSharp.SystemTextJson
which uses the same API's but with some F# sugar for those mentioned types

@pimbrouwers
Copy link
Owner

Hi Angel! (Badass name btw!)

Thank you very much for reaching out! I knew this topic would come up at some point and I should likely express my views in JSON more clearly in the documentation.

I included the jsonOut method as a convenience function for those times you need "quick and dirty" JSON output.

I explicitly chose not to include any meaningful JSON handlers or functionality beyond this because there isn't really a commonly accepted way of doing it. Thus, I figured it would be easiest to let people roll their own.

That said, if people were open to a dependency and could agree on a package. I would be more than happy to add full JSON support.

For the time being Ill update that documentation with a section on JSON to reflect my views on the subject.

@pimbrouwers pimbrouwers self-assigned this Apr 19, 2020
@pimbrouwers pimbrouwers added the documentation Improvements or additions to documentation label Apr 19, 2020
@AngelMunoz
Copy link
Contributor Author

Hi Angel! (Badass name btw!)

I'll thank my mother for that 😆

I explicitly chose not to include any meaningful JSON handlers or functionality beyond this because there isn't really a commonly accepted way of doing it. Thus, I figured it would be easiest to let people roll their own.

Yeah I get that 😁

Got it then thanks!

@pimbrouwers
Copy link
Owner

Documentation added in commit 19730fd

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

No branches or pull requests

2 participants