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

Add F# compatible json serializer #609

Merged
merged 5 commits into from
Jul 29, 2024

Conversation

fpellet
Copy link
Contributor

@fpellet fpellet commented Jul 27, 2024

Description

Add F# compatible json serializer with FSharp.SystemTextJson: Json.FsharpFriendlySerializer

How to test

Use Json.FsharpFriendlySerializer

Related issues

#604

@64J0 64J0 self-requested a review July 27, 2024 22:18
@64J0 64J0 linked an issue Jul 28, 2024 that may be closed by this pull request
@64J0
Copy link
Member

64J0 commented Jul 28, 2024

I added some commits to this PR @fpellet, let me know what you think, and feel free to revert them if you dislike it.

@fpellet
Copy link
Contributor Author

fpellet commented Jul 29, 2024

It's fine for me 👍

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is also second way - just use the recyclableMemoryStreamManager constant:

    new(settings : JsonSerializerSettings) = Serializer(
        settings,
        Lazy<RecyclableMemoryStreamManager>().Value)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you know if this other approach does provide some improvement compared to the one mentioned at this PR? Just curiosity due to this usage of Lazy<'T> and RecyclableMemoryStreamManager.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe not important one, but as Lazy<RecyclableMemoryStreamManager>() was the default, it was one argument less in code. :)

Just started using Giraffe and OpenApi and you guys are doing great work with those 🎉 👍

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it, thanks for the feedback 🚀

@64J0 64J0 merged commit 929eec8 into giraffe-fsharp:master Jul 29, 2024
6 checks passed
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

Successfully merging this pull request may close these issues.

F# compatible json serializer
3 participants