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

Simplify JSON serialization setup #417

Closed
mtmk opened this issue Feb 27, 2024 · 1 comment · Fixed by #433
Closed

Simplify JSON serialization setup #417

mtmk opened this issue Feb 27, 2024 · 1 comment · Fixed by #433
Assignees
Labels
good first issue Good for newcomers help wanted Extra attention is needed

Comments

@mtmk
Copy link
Collaborator

mtmk commented Feb 27, 2024

Proposed change

Currently because we're AOT compatible context or ad-hoc JSON serialization requires a bit of setup to register in the connection:

var jsonRegistry = new NatsJsonContextSerializerRegistry(MyJsonContext.Default);
return opts with { SerializerRegistry = jsonRegistry };

We should be able to simplify this when using hosting extensions.

@mtmk mtmk added good first issue Good for newcomers help wanted Extra attention is needed labels Feb 27, 2024
@rickdotnet
Copy link
Collaborator

I took an initial stab at this here as part of #392. Let me know if it aligns with what you were thinking and I can tweak it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
2 participants