Skip to content

Commit 97bda8f

Browse files
committed
Special handling for Quantity type
1 parent 3d9573c commit 97bda8f

File tree

2 files changed

+30
-255
lines changed

2 files changed

+30
-255
lines changed

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2018, 2021, Oracle and/or its affiliates.
1+
// Copyright (c) 2018, 2023, Oracle and/or its affiliates.
22
// Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
33

44
package oracle.kubernetes.json;
@@ -522,12 +522,12 @@ private class SubSchemaGenerator {
522522

523523
@SuppressWarnings("unchecked")
524524
private void generateTypeIn(Map<String, Object> result, Class<?> type) {
525-
if (type.equals(Boolean.class) || type.equals(Boolean.TYPE)) {
525+
if (isString(type) || type.getName().equals("io.kubernetes.client.custom.Quantity")) {
526+
result.put("type", "string");
527+
} else if (type.equals(Boolean.class) || type.equals(Boolean.TYPE)) {
526528
result.put("type", "boolean");
527529
} else if (isNumeric(type)) {
528530
result.put("type", "number");
529-
} else if (isString(type)) {
530-
result.put("type", "string");
531531
} else if (type.isEnum()) {
532532
generateEnumTypeIn(result, (Class<? extends Enum<?>>) type);
533533
} else if (type.isArray()) {

0 commit comments

Comments
 (0)