Skip to content

Commit 637522a

Browse files
committed
Correct generation of CRD for IntOrString type
1 parent eae28c2 commit 637522a

File tree

2 files changed

+84
-802
lines changed

2 files changed

+84
-802
lines changed

json-schema-generator/src/main/java/oracle/kubernetes/json/SchemaGenerator.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -522,7 +522,9 @@ private class SubSchemaGenerator {
522522

523523
@SuppressWarnings("unchecked")
524524
private void generateTypeIn(Map<String, Object> result, Class<?> type) {
525-
if (isString(type) || type.getName().equals("io.kubernetes.client.custom.Quantity")) {
525+
if (type.getName().equals("io.kubernetes.client.custom.IntOrString")) {
526+
result.put("x-kubernetes-int-or-string", Boolean.TRUE);
527+
} else if (isString(type) || type.getName().equals("io.kubernetes.client.custom.Quantity")) {
526528
result.put("type", "string");
527529
} else if (type.equals(Boolean.class) || type.equals(Boolean.TYPE)) {
528530
result.put("type", "boolean");

0 commit comments

Comments
 (0)