-
Notifications
You must be signed in to change notification settings - Fork 308
feat: add non-generic Deserialize method with dynamic code requirements to KubernetesJson #1701
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
base: master
Are you sure you want to change the base?
feat: add non-generic Deserialize method with dynamic code requirements to KubernetesJson #1701
Conversation
…ts for JSON serialization
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: kimpenhaus The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Welcome @kimpenhaus! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds a non-generic Deserialize(string json, Type returnType, JsonSerializerOptions jsonSerializerOptions = null) method to the KubernetesJson class. This provides an alternative to the existing generic Deserialize<TValue> methods when the target type is only known at runtime, enabling more flexible use of the Kubernetes client's JSON serialization infrastructure.
Key changes:
- Adds a new public non-generic Deserialize method that accepts a Type parameter
- Includes appropriate
RequiresDynamicCodeandRequiresUnreferencedCodeattributes for .NET 8.0+ to warn about AOT compatibility concerns - Imports
System.Diagnostics.CodeAnalysisnamespace for the new attributes
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…type support - implemented suggested improvements - added unit-test
…upport - added xml doc
…non-generic-method
this PR adds a non-generic Deserialise method to
KubernetesJson.csReason:
based on this discussion adding a non generic
Deserializemethod gives the opportunity to use the same json serialisation mechanism everywhere - when using KubernetesClient package.