-
Notifications
You must be signed in to change notification settings - Fork 479
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
Use custom serializer options for responses instead of default one #1715
Comments
@Nairda015 Good afternoon. Have you tried using Thanks, |
I agree this is a gap in Annotations to be able to customize the HTTP response body JSON serialization outside if using System.Text.Json's .NET attributes on your POCO for serialization customization. How would you feel if we allowed adding an interface implementation into the dependency injection container for customizing the serialization options? |
Sounds good but why we can't reuse serialization options from custom serializer it is already there (I updated the links in original comment because there was duplication instead of this example above) |
This should have been addressed via PR #1748 and available in Amazon.Lambda.Annotations v1.4.0 package. |
Comments on closed issues are hard for our team to see. |
Describe the bug
I don't see a way to set serialization options on all responses from lambda
Expected Behavior
I can control serialization options of responses like DefaultIgnoreCondition
Current Behavior
Default serializer is used and I have no idea how to override it's behavior
Reproduction Steps
Create custom serializer like in this example with DefaultIgnoreCondition set to WhenWrittingNull and return json with null values
Possible Solution
Here I want to use serializer options from custom serializer like in this example instead of default one.
It will require changes in if check from first link and maybe here
Additional Information/Context
AWS .NET SDK and/or Package version used
Annotation.Framework 1.2
Targeted .NET Platform
.NET 6
Operating System and version
AmazonLinux
The text was updated successfully, but these errors were encountered: