Skip to content

Conversation

@kimpenhaus
Copy link

this PR adds a non-generic Deserialise method to KubernetesJson.cs

Reason:

based on this discussion adding a non generic Deserialize method gives the opportunity to use the same json serialisation mechanism everywhere - when using KubernetesClient package.

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: kimpenhaus
Once this PR has been reviewed and has the lgtm label, please assign brendandburns for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot requested a review from tg123 December 11, 2025 12:56
@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Dec 11, 2025

CLA Signed

The committers listed above are authorized under a signed CLA.

@k8s-ci-robot
Copy link
Contributor

Welcome @kimpenhaus!

It looks like this is your first PR to kubernetes-client/csharp 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes-client/csharp has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot k8s-ci-robot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. and removed cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. labels Dec 11, 2025
@tg123 tg123 requested a review from Copilot December 15, 2025 23:21
Copy link
Contributor

Copilot AI left a 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 RequiresDynamicCode and RequiresUnreferencedCode attributes for .NET 8.0+ to warn about AOT compatibility concerns
  • Imports System.Diagnostics.CodeAnalysis namespace 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
@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Dec 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants