-
Notifications
You must be signed in to change notification settings - Fork 305
feat: enhance Kubernetes client with watch functionality #1667
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
Changes from 10 commits
80b46b7
6979dd5
136b103
f9a3d9c
201be85
942a645
9ac1f9c
4d752ed
5e47c09
6de5558
c6bda21
85d7011
0877710
09a7717
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -245,6 +245,16 @@ | |||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| break; | ||||||||||||||||||||||||||||||||
| case "T": | ||||||||||||||||||||||||||||||||
| var itemType = TryGetItemTypeFromSchema(response); | ||||||||||||||||||||||||||||||||
tg123 marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||||||||||||||||||||||||
| if (itemType != null) | ||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||
| return itemType; | ||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| break; | ||||||||||||||||||||||||||||||||
| case "TList": | ||||||||||||||||||||||||||||||||
| return t; | ||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| return t; | ||||||||||||||||||||||||||||||||
|
|
@@ -283,5 +293,26 @@ | |||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| return false; | ||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| private string TryGetItemTypeFromSchema(OpenApiResponse response) | ||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||
| var listSchema = response?.Schema?.Reference; | ||||||||||||||||||||||||||||||||
| if (listSchema?.Properties?.TryGetValue("items", out var itemsProperty) != true) | ||||||||||||||||||||||||||||||||
|
Comment on lines
+298
to
+299
|
||||||||||||||||||||||||||||||||
| var listSchema = response?.Schema?.Reference; | |
| if (listSchema?.Properties?.TryGetValue("items", out var itemsProperty) != true) | |
| // Resolve the schema reference to the actual schema object | |
| var referencedSchema = response?.Schema?.ActualSchema; | |
| if (referencedSchema?.Properties?.TryGetValue("items", out var itemsProperty) != true) |
Copilot
AI
Sep 29, 2025
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.
The method attempts to access Properties on a JsonReference object, but JsonReference doesn't have a Properties property. This will always return null. You should resolve the reference first to get the actual schema.
| var listSchema = response?.Schema?.Reference; | |
| if (listSchema?.Properties?.TryGetValue("items", out var itemsProperty) != true) | |
| { | |
| return null; | |
| } | |
| // Resolve the reference to the actual schema before accessing Properties | |
| var referencedSchema = response?.Schema?.Reference as JsonSchema; | |
| if (referencedSchema == null) | |
| { | |
| return null; | |
| } | |
| if (!referencedSchema.Properties.TryGetValue("items", out var itemsProperty)) | |
| { | |
| return null; | |
| } |
Check warning on line 309 in src/LibKubernetesGenerator/TypeHelper.cs
GitHub Actions / Analyze (csharp)
Code should not contain trailing whitespace (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1028.md)
Check warning on line 309 in src/LibKubernetesGenerator/TypeHelper.cs
GitHub Actions / Dotnet build (macOS-latest)
Code should not contain trailing whitespace (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1028.md)
Uh oh!
There was an error while loading. Please reload this page.