Skip to content

Conversation

@IvanJosipovic
Copy link
Contributor

@IvanJosipovic IvanJosipovic commented Dec 3, 2025

This PR updates all the JsonConverters to public

Reason

In order to be able to make custom SourceGeneration configs, the JsonConverters have to be public, otherwise an exception is thrown. Related to #1670

The name 'ResourceQuantity' does not exist in the current context

[JsonSerializable(typeof(KubernetesList<V1Pod>))]
[JsonSourceGenerationOptions(
    DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull,
    PropertyNamingPolicy = JsonKnownNamingPolicy.CamelCase,
    UseStringEnumConverter = true,
    Converters = new[] { typeof(Iso8601TimeSpanConverter), typeof(KubernetesDateTimeConverter), typeof(KubernetesDateTimeOffsetConverter), typeof(V1Status.V1StatusObjectViewConverter) })
]
public partial class CustomSourceGenerationContext : JsonSerializerContext
{
}

Copilot AI review requested due to automatic review settings December 3, 2025 02:07
@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Dec 3, 2025
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 makes JsonConverter classes public to enable custom SourceGeneration configurations. When JsonConverters remain internal, referencing them in custom JsonSourceGenerationOptions causes compilation errors.

Key Changes:

  • Changed visibility of all JsonConverter classes from internal to public
  • Applied changes consistently across both regular and AOT project files

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
src/KubernetesClient/Models/V1PatchJsonConverter.cs Changed V1PatchJsonConverter from internal to public
src/KubernetesClient/Models/ResourceQuantityJsonConverter.cs Changed ResourceQuantityJsonConverter from internal to public
src/KubernetesClient/Models/IntOrStringJsonConverter.cs Changed IntOrStringJsonConverter from internal to public
src/KubernetesClient.Aot/V1PatchJsonConverter.cs Changed V1PatchJsonConverter from internal to public in AOT project

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@k8s-ci-robot k8s-ci-robot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Dec 3, 2025
@tg123
Copy link
Member

tg123 commented Dec 15, 2025

/LGTM

the reason i set them to private is that i do not want to hide as much as possible to make crazy change freely :)

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Dec 15, 2025
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: IvanJosipovic, tg123

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

The pull request process is described 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 added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Dec 15, 2025
@k8s-ci-robot k8s-ci-robot merged commit 999f1e6 into kubernetes-client:master Dec 15, 2025
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants