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

Commit 426d24e

Browse files
committed
Adds @nullables back into instanceof checks
1 parent 137b5b6 commit 426d24e

File tree

76 files changed

+122
-121
lines changed

Some content is hidden

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

76 files changed

+122
-121
lines changed

samples/client/3_0_3_unit_test/java/.openapi-generator/FILES

+1
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,7 @@ src/main/java/org/openapijsonschematools/client/schemas/validation/TypeValidator
244244
src/main/java/org/openapijsonschematools/client/schemas/validation/UniqueItemsValidator.java
245245
src/main/java/org/openapijsonschematools/client/schemas/validation/UnsetAnyTypeJsonSchema.java
246246
src/main/java/org/openapijsonschematools/client/schemas/validation/ValidationMetadata.java
247+
src/test/java/org/openapijsonschematools/client/components/schemas/AllofWithBaseSchemaTest.java
247248
src/test/java/org/openapijsonschematools/client/configurations/JsonSchemaKeywordFlagsTest.java
248249
src/test/java/org/openapijsonschematools/client/schemas/AnyTypeSchemaTest.java
249250
src/test/java/org/openapijsonschematools/client/schemas/ArrayTypeSchemaTest.java

samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesAllowsASchemaWhichShouldValidate.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ public AdditionalpropertiesAllowsASchemaWhichShouldValidateMap getNewInstance(Ma
146146
}
147147
JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey();
148148
@Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas);
149-
if (!(propertyInstance instanceof Object)) {
149+
if (!(propertyInstance instanceof @Nullable Object)) {
150150
throw new InvalidTypeException("Invalid instantiated value");
151151
}
152152
properties.put(propertyName, (@Nullable Object) propertyInstance);

samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesAreAllowedByDefault.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ public AdditionalpropertiesAreAllowedByDefaultMap getNewInstance(Map<?, ?> arg,
248248
}
249249
JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey();
250250
@Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas);
251-
if (!(propertyInstance instanceof Object)) {
251+
if (!(propertyInstance instanceof @Nullable Object)) {
252252
throw new InvalidTypeException("Invalid instantiated value");
253253
}
254254
properties.put(propertyName, (@Nullable Object) propertyInstance);

samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesShouldNotLookInApplicators.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ public Schema0Map getNewInstance(Map<?, ?> arg, List<Object> pathToItem, PathToS
235235
}
236236
JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey();
237237
@Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas);
238-
if (!(propertyInstance instanceof Object)) {
238+
if (!(propertyInstance instanceof @Nullable Object)) {
239239
throw new InvalidTypeException("Invalid instantiated value");
240240
}
241241
properties.put(propertyName, (@Nullable Object) propertyInstance);

samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Allof.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ public Schema0Map getNewInstance(Map<?, ?> arg, List<Object> pathToItem, PathToS
229229
}
230230
JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey();
231231
@Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas);
232-
if (!(propertyInstance instanceof Object)) {
232+
if (!(propertyInstance instanceof @Nullable Object)) {
233233
throw new InvalidTypeException("Invalid instantiated value");
234234
}
235235
properties.put(propertyName, (@Nullable Object) propertyInstance);
@@ -461,7 +461,7 @@ public Schema1Map getNewInstance(Map<?, ?> arg, List<Object> pathToItem, PathToS
461461
}
462462
JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey();
463463
@Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas);
464-
if (!(propertyInstance instanceof Object)) {
464+
if (!(propertyInstance instanceof @Nullable Object)) {
465465
throw new InvalidTypeException("Invalid instantiated value");
466466
}
467467
properties.put(propertyName, (@Nullable Object) propertyInstance);
@@ -655,7 +655,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid
655655
}
656656
JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey();
657657
@Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas);
658-
if (!(propertyInstance instanceof Object)) {
658+
if (!(propertyInstance instanceof @Nullable Object)) {
659659
throw new InvalidTypeException("Invalid instantiated value");
660660
}
661661
properties.put(propertyName, (@Nullable Object) propertyInstance);

samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofCombinedWithAnyofOneof.java

+4-4
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid
180180
}
181181
JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey();
182182
@Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas);
183-
if (!(propertyInstance instanceof Object)) {
183+
if (!(propertyInstance instanceof @Nullable Object)) {
184184
throw new InvalidTypeException("Invalid instantiated value");
185185
}
186186
properties.put(propertyName, (@Nullable Object) propertyInstance);
@@ -365,7 +365,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid
365365
}
366366
JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey();
367367
@Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas);
368-
if (!(propertyInstance instanceof Object)) {
368+
if (!(propertyInstance instanceof @Nullable Object)) {
369369
throw new InvalidTypeException("Invalid instantiated value");
370370
}
371371
properties.put(propertyName, (@Nullable Object) propertyInstance);
@@ -550,7 +550,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid
550550
}
551551
JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey();
552552
@Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas);
553-
if (!(propertyInstance instanceof Object)) {
553+
if (!(propertyInstance instanceof @Nullable Object)) {
554554
throw new InvalidTypeException("Invalid instantiated value");
555555
}
556556
properties.put(propertyName, (@Nullable Object) propertyInstance);
@@ -749,7 +749,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid
749749
}
750750
JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey();
751751
@Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas);
752-
if (!(propertyInstance instanceof Object)) {
752+
if (!(propertyInstance instanceof @Nullable Object)) {
753753
throw new InvalidTypeException("Invalid instantiated value");
754754
}
755755
properties.put(propertyName, (@Nullable Object) propertyInstance);

samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofSimpleTypes.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid
179179
}
180180
JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey();
181181
@Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas);
182-
if (!(propertyInstance instanceof Object)) {
182+
if (!(propertyInstance instanceof @Nullable Object)) {
183183
throw new InvalidTypeException("Invalid instantiated value");
184184
}
185185
properties.put(propertyName, (@Nullable Object) propertyInstance);
@@ -364,7 +364,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid
364364
}
365365
JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey();
366366
@Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas);
367-
if (!(propertyInstance instanceof Object)) {
367+
if (!(propertyInstance instanceof @Nullable Object)) {
368368
throw new InvalidTypeException("Invalid instantiated value");
369369
}
370370
properties.put(propertyName, (@Nullable Object) propertyInstance);
@@ -558,7 +558,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid
558558
}
559559
JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey();
560560
@Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas);
561-
if (!(propertyInstance instanceof Object)) {
561+
if (!(propertyInstance instanceof @Nullable Object)) {
562562
throw new InvalidTypeException("Invalid instantiated value");
563563
}
564564
properties.put(propertyName, (@Nullable Object) propertyInstance);

samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithBaseSchema.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ public Schema0Map getNewInstance(Map<?, ?> arg, List<Object> pathToItem, PathToS
230230
}
231231
JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey();
232232
@Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas);
233-
if (!(propertyInstance instanceof Object)) {
233+
if (!(propertyInstance instanceof @Nullable Object)) {
234234
throw new InvalidTypeException("Invalid instantiated value");
235235
}
236236
properties.put(propertyName, (@Nullable Object) propertyInstance);
@@ -462,7 +462,7 @@ public Schema1Map getNewInstance(Map<?, ?> arg, List<Object> pathToItem, PathToS
462462
}
463463
JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey();
464464
@Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas);
465-
if (!(propertyInstance instanceof Object)) {
465+
if (!(propertyInstance instanceof @Nullable Object)) {
466466
throw new InvalidTypeException("Invalid instantiated value");
467467
}
468468
properties.put(propertyName, (@Nullable Object) propertyInstance);
@@ -704,7 +704,7 @@ public AllofWithBaseSchemaMap getNewInstance(Map<?, ?> arg, List<Object> pathToI
704704
}
705705
JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey();
706706
@Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas);
707-
if (!(propertyInstance instanceof Object)) {
707+
if (!(propertyInstance instanceof @Nullable Object)) {
708708
throw new InvalidTypeException("Invalid instantiated value");
709709
}
710710
properties.put(propertyName, (@Nullable Object) propertyInstance);

samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithOneEmptySchema.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid
199199
}
200200
JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey();
201201
@Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas);
202-
if (!(propertyInstance instanceof Object)) {
202+
if (!(propertyInstance instanceof @Nullable Object)) {
203203
throw new InvalidTypeException("Invalid instantiated value");
204204
}
205205
properties.put(propertyName, (@Nullable Object) propertyInstance);

samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithTheFirstEmptySchema.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid
212212
}
213213
JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey();
214214
@Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas);
215-
if (!(propertyInstance instanceof Object)) {
215+
if (!(propertyInstance instanceof @Nullable Object)) {
216216
throw new InvalidTypeException("Invalid instantiated value");
217217
}
218218
properties.put(propertyName, (@Nullable Object) propertyInstance);

samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithTheLastEmptySchema.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid
212212
}
213213
JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey();
214214
@Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas);
215-
if (!(propertyInstance instanceof Object)) {
215+
if (!(propertyInstance instanceof @Nullable Object)) {
216216
throw new InvalidTypeException("Invalid instantiated value");
217217
}
218218
properties.put(propertyName, (@Nullable Object) propertyInstance);

samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithTwoEmptySchemas.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid
211211
}
212212
JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey();
213213
@Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas);
214-
if (!(propertyInstance instanceof Object)) {
214+
if (!(propertyInstance instanceof @Nullable Object)) {
215215
throw new InvalidTypeException("Invalid instantiated value");
216216
}
217217
properties.put(propertyName, (@Nullable Object) propertyInstance);

samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Anyof.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid
191191
}
192192
JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey();
193193
@Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas);
194-
if (!(propertyInstance instanceof Object)) {
194+
if (!(propertyInstance instanceof @Nullable Object)) {
195195
throw new InvalidTypeException("Invalid instantiated value");
196196
}
197197
properties.put(propertyName, (@Nullable Object) propertyInstance);
@@ -385,7 +385,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid
385385
}
386386
JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey();
387387
@Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas);
388-
if (!(propertyInstance instanceof Object)) {
388+
if (!(propertyInstance instanceof @Nullable Object)) {
389389
throw new InvalidTypeException("Invalid instantiated value");
390390
}
391391
properties.put(propertyName, (@Nullable Object) propertyInstance);

samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofComplexTypes.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ public Schema0Map getNewInstance(Map<?, ?> arg, List<Object> pathToItem, PathToS
229229
}
230230
JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey();
231231
@Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas);
232-
if (!(propertyInstance instanceof Object)) {
232+
if (!(propertyInstance instanceof @Nullable Object)) {
233233
throw new InvalidTypeException("Invalid instantiated value");
234234
}
235235
properties.put(propertyName, (@Nullable Object) propertyInstance);
@@ -461,7 +461,7 @@ public Schema1Map getNewInstance(Map<?, ?> arg, List<Object> pathToItem, PathToS
461461
}
462462
JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey();
463463
@Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas);
464-
if (!(propertyInstance instanceof Object)) {
464+
if (!(propertyInstance instanceof @Nullable Object)) {
465465
throw new InvalidTypeException("Invalid instantiated value");
466466
}
467467
properties.put(propertyName, (@Nullable Object) propertyInstance);
@@ -655,7 +655,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid
655655
}
656656
JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey();
657657
@Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas);
658-
if (!(propertyInstance instanceof Object)) {
658+
if (!(propertyInstance instanceof @Nullable Object)) {
659659
throw new InvalidTypeException("Invalid instantiated value");
660660
}
661661
properties.put(propertyName, (@Nullable Object) propertyInstance);

samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofWithBaseSchema.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid
179179
}
180180
JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey();
181181
@Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas);
182-
if (!(propertyInstance instanceof Object)) {
182+
if (!(propertyInstance instanceof @Nullable Object)) {
183183
throw new InvalidTypeException("Invalid instantiated value");
184184
}
185185
properties.put(propertyName, (@Nullable Object) propertyInstance);
@@ -364,7 +364,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid
364364
}
365365
JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey();
366366
@Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas);
367-
if (!(propertyInstance instanceof Object)) {
367+
if (!(propertyInstance instanceof @Nullable Object)) {
368368
throw new InvalidTypeException("Invalid instantiated value");
369369
}
370370
properties.put(propertyName, (@Nullable Object) propertyInstance);

samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofWithOneEmptySchema.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid
212212
}
213213
JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey();
214214
@Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas);
215-
if (!(propertyInstance instanceof Object)) {
215+
if (!(propertyInstance instanceof @Nullable Object)) {
216216
throw new InvalidTypeException("Invalid instantiated value");
217217
}
218218
properties.put(propertyName, (@Nullable Object) propertyInstance);

samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ArrayTypeMatchesArrays.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ public ArrayTypeMatchesArraysList getNewInstance(List<?> arg, List<Object> pathT
8686
}
8787
JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey();
8888
@Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas);
89-
if (!(itemInstance instanceof Object)) {
89+
if (!(itemInstance instanceof @Nullable Object)) {
9090
throw new InvalidTypeException("Invalid instantiated value");
9191
}
9292
items.add((@Nullable Object) itemInstance);

samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ByInt.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid
186186
}
187187
JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey();
188188
@Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas);
189-
if (!(propertyInstance instanceof Object)) {
189+
if (!(propertyInstance instanceof @Nullable Object)) {
190190
throw new InvalidTypeException("Invalid instantiated value");
191191
}
192192
properties.put(propertyName, (@Nullable Object) propertyInstance);

0 commit comments

Comments
 (0)