Skip to content

Commit a3e16fa

Browse files
committed
Special handling for Quantity type
1 parent d0fa742 commit a3e16fa

File tree

5 files changed

+10862
-11771
lines changed

5 files changed

+10862
-11771
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -532,14 +532,14 @@ private void generateEnumTypeIn(Map<String, Object> result, Class<? extends Enum
532532

533533
@SuppressWarnings("unchecked")
534534
private void generateTypeIn(Map<String, Object> result, Class<?> type) {
535-
if (isBoolean(type)) {
535+
if (isString(type) || type.getName().equals("io.kubernetes.client.custom.Quantity")) {
536+
result.put(TYPE, STRING);
537+
} else if (isBoolean(type)) {
536538
result.put(TYPE, BOOLEAN);
537539
} else if (isScalarNumeric(type)) {
538540
result.put(TYPE, INTEGER);
539541
} else if (isFloatingNumeric(type)) {
540542
result.put(TYPE, NUMBER);
541-
} else if (isString(type)) {
542-
result.put(TYPE, STRING);
543543
} else if (type.isEnum()) {
544544
generateEnumTypeIn(result, (Class<? extends Enum<?>>) type);
545545
} else if (type.isArray()) {

kubernetes/crd/cluster-crd.yaml

Lines changed: 7 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ apiVersion: apiextensions.k8s.io/v1
55
kind: CustomResourceDefinition
66
metadata:
77
annotations:
8-
weblogic.sha256: ffde049cbfc1e4ed71b15848d7cfcc06b79619f6b7e76bd564d8466c3f045e9f
8+
weblogic.sha256: f19085ef94808bd2579ce399e5958ea0607b8877fc2fd2dbe78151b3b240cc49
99
name: clusters.weblogic.oracle
1010
spec:
1111
group: weblogic.oracle
@@ -659,16 +659,7 @@ spec:
659659
type: object
660660
properties:
661661
divisor:
662-
type: object
663-
properties:
664-
number:
665-
type: integer
666-
format:
667-
type: string
668-
enum:
669-
- DECIMAL_EXPONENT
670-
- DECIMAL_SI
671-
- BINARY_SI
662+
type: string
672663
resource:
673664
type: string
674665
containerName:
@@ -797,16 +788,7 @@ spec:
797788
type: object
798789
properties:
799790
sizeLimit:
800-
type: object
801-
properties:
802-
number:
803-
type: integer
804-
format:
805-
type: string
806-
enum:
807-
- DECIMAL_EXPONENT
808-
- DECIMAL_SI
809-
- BINARY_SI
791+
type: string
810792
medium:
811793
type: string
812794
glusterfs:
@@ -895,16 +877,7 @@ spec:
895877
type: object
896878
properties:
897879
divisor:
898-
type: object
899-
properties:
900-
number:
901-
type: integer
902-
format:
903-
type: string
904-
enum:
905-
- DECIMAL_EXPONENT
906-
- DECIMAL_SI
907-
- BINARY_SI
880+
type: string
908881
resource:
909882
type: string
910883
containerName:
@@ -1191,16 +1164,7 @@ spec:
11911164
type: object
11921165
properties:
11931166
divisor:
1194-
type: object
1195-
properties:
1196-
number:
1197-
type: integer
1198-
format:
1199-
type: string
1200-
enum:
1201-
- DECIMAL_EXPONENT
1202-
- DECIMAL_SI
1203-
- BINARY_SI
1167+
type: string
12041168
resource:
12051169
type: string
12061170
containerName:
@@ -1540,16 +1504,7 @@ spec:
15401504
type: object
15411505
properties:
15421506
divisor:
1543-
type: object
1544-
properties:
1545-
number:
1546-
type: integer
1547-
format:
1548-
type: string
1549-
enum:
1550-
- DECIMAL_EXPONENT
1551-
- DECIMAL_SI
1552-
- BINARY_SI
1507+
type: string
15531508
resource:
15541509
type: string
15551510
containerName:
@@ -2156,16 +2111,7 @@ spec:
21562111
type: object
21572112
properties:
21582113
divisor:
2159-
type: object
2160-
properties:
2161-
number:
2162-
type: integer
2163-
format:
2164-
type: string
2165-
enum:
2166-
- DECIMAL_EXPONENT
2167-
- DECIMAL_SI
2168-
- BINARY_SI
2114+
type: string
21692115
resource:
21702116
type: string
21712117
containerName:

0 commit comments

Comments
 (0)