Skip to content
This repository was archived by the owner on Dec 25, 2024. It is now read-only.

Commit 5804717

Browse files
authored
Java, eliminate unsafe casts (#338)
* Updates FrozenList/Map to use AbstractList/Map * Refactors castToAllowedTypes into JsonSchema * Fixes for any type schemas * Fixes more template errors * Removes unneeded casting methods * Removes more unneeded methods * Fixes java tests * Removes getNewInstance from non collection types * Has casting return list and map wildcard types * Removes unchecked casts in getNewInstance * Removes unchecked casts in getnewinstance with object input * Removes unused variables, fixes variable names * Updates ArrayTypeSchemaTest * Updates ObjectTypeSchemaTest * Java tests fixed * Samples regen
1 parent 1a7800b commit 5804717

File tree

530 files changed

+9155
-20567
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

530 files changed

+9155
-20567
lines changed

samples/client/3_0_3_unit_test/java/docs/components/schemas/AdditionalpropertiesAllowsASchemaWhichShouldValidate.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ AdditionalpropertiesAllowsASchemaWhichShouldValidate.AdditionalpropertiesAllowsA
5252
### Field Summary
5353
| Modifier and Type | Field and Description |
5454
| ----------------- | ---------------------- |
55-
| Set<Class<?>> | &nbsp;&nbsp;&nbsp;&nbsp;type = Set.of(FrozenMap.class)<br/> |
55+
| Set<Class<?>> | &nbsp;&nbsp;&nbsp;&nbsp;type = Set.of(Map.class)<br/> |
5656
| Map<String, Class<? extends JsonSchema>> | &nbsp;&nbsp;&nbsp;&nbsp;properties = Map.ofEntries(<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;new PropertyEntry("foo", [Foo.class](#foo))),<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;new PropertyEntry("bar", [Bar.class](#bar)))<br>&nbsp;&nbsp;&nbsp;&nbsp;)<br> |
5757
| Class<? extends JsonSchema> | &nbsp;&nbsp;&nbsp;&nbsp;additionalProperties = [AdditionalProperties.class](#additionalproperties)<br> |
5858

samples/client/3_0_3_unit_test/java/docs/components/schemas/AdditionalpropertiesCanExistByItself.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ AdditionalpropertiesCanExistByItself.AdditionalpropertiesCanExistByItselfMap val
5050
### Field Summary
5151
| Modifier and Type | Field and Description |
5252
| ----------------- | ---------------------- |
53-
| Set<Class<?>> | &nbsp;&nbsp;&nbsp;&nbsp;type = Set.of(FrozenMap.class)<br/> |
53+
| Set<Class<?>> | &nbsp;&nbsp;&nbsp;&nbsp;type = Set.of(Map.class)<br/> |
5454
| Class<? extends JsonSchema> | &nbsp;&nbsp;&nbsp;&nbsp;additionalProperties = [AdditionalProperties.class](#additionalproperties)<br> |
5555

5656
### Method Summary

samples/client/3_0_3_unit_test/java/docs/components/schemas/ArrayTypeMatchesArrays.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ ArrayTypeMatchesArrays.ArrayTypeMatchesArraysList validatedPayload =
5050
### Field Summary
5151
| Modifier and Type | Field and Description |
5252
| ----------------- | ---------------------- |
53-
| Set<Class<?>> | &nbsp;&nbsp;&nbsp;&nbsp;type = Set.of(FrozenList.class)<br/> |
53+
| Set<Class<?>> | &nbsp;&nbsp;&nbsp;&nbsp;type = Set.of(List.class)<br/> |
5454
| Class<? extends JsonSchema> | &nbsp;&nbsp;&nbsp;&nbsp;items = [Items.class](#items)<br> |
5555

5656
### Method Summary

samples/client/3_0_3_unit_test/java/docs/components/schemas/EnumsInProperties.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ EnumsInProperties.EnumsInPropertiesMap validatedPayload =
5959
### Field Summary
6060
| Modifier and Type | Field and Description |
6161
| ----------------- | ---------------------- |
62-
| Set<Class<?>> | &nbsp;&nbsp;&nbsp;&nbsp;type = Set.of(FrozenMap.class)<br/> |
62+
| Set<Class<?>> | &nbsp;&nbsp;&nbsp;&nbsp;type = Set.of(Map.class)<br/> |
6363
| Map<String, Class<? extends JsonSchema>> | &nbsp;&nbsp;&nbsp;&nbsp;properties = Map.ofEntries(<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;new PropertyEntry("foo", [Foo.class](#foo))),<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;new PropertyEntry("bar", [Bar.class](#bar)))<br>&nbsp;&nbsp;&nbsp;&nbsp;)<br> |
6464
| Set<String> | &nbsp;&nbsp;&nbsp;&nbsp;required = Set.of(<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"bar"<br>&nbsp;&nbsp;&nbsp;&nbsp;)<br> |
6565

samples/client/3_0_3_unit_test/java/docs/components/schemas/NestedItems.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ NestedItems.NestedItemsList validatedPayload =
6666
### Field Summary
6767
| Modifier and Type | Field and Description |
6868
| ----------------- | ---------------------- |
69-
| Set<Class<?>> | &nbsp;&nbsp;&nbsp;&nbsp;type = Set.of(FrozenList.class)<br/> |
69+
| Set<Class<?>> | &nbsp;&nbsp;&nbsp;&nbsp;type = Set.of(List.class)<br/> |
7070
| Class<? extends JsonSchema> | &nbsp;&nbsp;&nbsp;&nbsp;items = [Items.class](#items)<br> |
7171

7272
### Method Summary
@@ -134,7 +134,7 @@ NestedItems.ItemsList2 validatedPayload =
134134
### Field Summary
135135
| Modifier and Type | Field and Description |
136136
| ----------------- | ---------------------- |
137-
| Set<Class<?>> | &nbsp;&nbsp;&nbsp;&nbsp;type = Set.of(FrozenList.class)<br/> |
137+
| Set<Class<?>> | &nbsp;&nbsp;&nbsp;&nbsp;type = Set.of(List.class)<br/> |
138138
| Class<? extends JsonSchema> | &nbsp;&nbsp;&nbsp;&nbsp;items = [Items1.class](#items1)<br> |
139139

140140
### Method Summary
@@ -200,7 +200,7 @@ NestedItems.ItemsList1 validatedPayload =
200200
### Field Summary
201201
| Modifier and Type | Field and Description |
202202
| ----------------- | ---------------------- |
203-
| Set<Class<?>> | &nbsp;&nbsp;&nbsp;&nbsp;type = Set.of(FrozenList.class)<br/> |
203+
| Set<Class<?>> | &nbsp;&nbsp;&nbsp;&nbsp;type = Set.of(List.class)<br/> |
204204
| Class<? extends JsonSchema> | &nbsp;&nbsp;&nbsp;&nbsp;items = [Items2.class](#items2)<br> |
205205

206206
### Method Summary
@@ -264,7 +264,7 @@ NestedItems.ItemsList validatedPayload =
264264
### Field Summary
265265
| Modifier and Type | Field and Description |
266266
| ----------------- | ---------------------- |
267-
| Set<Class<?>> | &nbsp;&nbsp;&nbsp;&nbsp;type = Set.of(FrozenList.class)<br/> |
267+
| Set<Class<?>> | &nbsp;&nbsp;&nbsp;&nbsp;type = Set.of(List.class)<br/> |
268268
| Class<? extends JsonSchema> | &nbsp;&nbsp;&nbsp;&nbsp;items = [Items3.class](#items3)<br> |
269269

270270
### Method Summary

samples/client/3_0_3_unit_test/java/docs/components/schemas/NotMoreComplexSchema.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ NotMoreComplexSchema.NotMap validatedPayload =
7979
### Field Summary
8080
| Modifier and Type | Field and Description |
8181
| ----------------- | ---------------------- |
82-
| Set<Class<?>> | &nbsp;&nbsp;&nbsp;&nbsp;type = Set.of(FrozenMap.class)<br/> |
82+
| Set<Class<?>> | &nbsp;&nbsp;&nbsp;&nbsp;type = Set.of(Map.class)<br/> |
8383
| Map<String, Class<? extends JsonSchema>> | &nbsp;&nbsp;&nbsp;&nbsp;properties = Map.ofEntries(<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;new PropertyEntry("foo", [Foo.class](#foo)))<br>&nbsp;&nbsp;&nbsp;&nbsp;)<br> |
8484

8585
### Method Summary

samples/client/3_0_3_unit_test/java/docs/components/schemas/OneofWithRequired.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ A schema class that validates payloads
2929
### Field Summary
3030
| Modifier and Type | Field and Description |
3131
| ----------------- | ---------------------- |
32-
| Set<Class<?>> | &nbsp;&nbsp;&nbsp;&nbsp;type = Set.of(FrozenMap.class)<br/> |
32+
| Set<Class<?>> | &nbsp;&nbsp;&nbsp;&nbsp;type = Set.of(Map.class)<br/> |
3333
| List<Class<? extends JsonSchema>> | &nbsp;&nbsp;&nbsp;&nbsp;oneOf = List.of(<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Schema0.class](#schema0),<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Schema1.class](#schema1)<br>&nbsp;&nbsp;&nbsp;&nbsp;))<br> |
3434

3535
### Method Summary

samples/client/3_0_3_unit_test/java/docs/components/schemas/RefInAdditionalproperties.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ RefInAdditionalproperties.RefInAdditionalpropertiesMap validatedPayload =
4949
### Field Summary
5050
| Modifier and Type | Field and Description |
5151
| ----------------- | ---------------------- |
52-
| Set<Class<?>> | &nbsp;&nbsp;&nbsp;&nbsp;type = Set.of(FrozenMap.class)<br/> |
52+
| Set<Class<?>> | &nbsp;&nbsp;&nbsp;&nbsp;type = Set.of(Map.class)<br/> |
5353
| Class<? extends JsonSchema> | &nbsp;&nbsp;&nbsp;&nbsp;additionalProperties = [PropertyNamedRefThatIsNotAReference.PropertyNamedRefThatIsNotAReference1.class](../../components/schemas/PropertyNamedRefThatIsNotAReference.md#propertynamedrefthatisnotareference1)<br> |
5454

5555
### Method Summary

samples/client/3_0_3_unit_test/java/docs/components/schemas/RefInItems.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ RefInItems.RefInItemsList validatedPayload =
4949
### Field Summary
5050
| Modifier and Type | Field and Description |
5151
| ----------------- | ---------------------- |
52-
| Set<Class<?>> | &nbsp;&nbsp;&nbsp;&nbsp;type = Set.of(FrozenList.class)<br/> |
52+
| Set<Class<?>> | &nbsp;&nbsp;&nbsp;&nbsp;type = Set.of(List.class)<br/> |
5353
| Class<? extends JsonSchema> | &nbsp;&nbsp;&nbsp;&nbsp;items = [PropertyNamedRefThatIsNotAReference.PropertyNamedRefThatIsNotAReference1.class](../../components/schemas/PropertyNamedRefThatIsNotAReference.md#propertynamedrefthatisnotareference1)<br> |
5454

5555
### Method Summary

samples/client/3_0_3_unit_test/java/docs/components/schemas/TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing.TheDefaultKeywordDoesNo
5454
### Field Summary
5555
| Modifier and Type | Field and Description |
5656
| ----------------- | ---------------------- |
57-
| Set<Class<?>> | &nbsp;&nbsp;&nbsp;&nbsp;type = Set.of(FrozenMap.class)<br/> |
57+
| Set<Class<?>> | &nbsp;&nbsp;&nbsp;&nbsp;type = Set.of(Map.class)<br/> |
5858
| Map<String, Class<? extends JsonSchema>> | &nbsp;&nbsp;&nbsp;&nbsp;properties = Map.ofEntries(<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;new PropertyEntry("alpha", [Alpha.class](#alpha)))<br>&nbsp;&nbsp;&nbsp;&nbsp;)<br> |
5959

6060
### Method Summary

0 commit comments

Comments
 (0)