Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Java, adds checker framework, unused #340

Closed
wants to merge 52 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
fa5f875
Checker framework added
spacether Dec 18, 2023
1be0dcc
Adds missing compilerArgs for the checker framework
spacether Dec 18, 2023
a96c7a1
Adds some needed annotations
spacether Dec 19, 2023
169ac9d
Adds nullable annotation to getNewInstance object input
spacether Dec 19, 2023
318db0d
Adds and uses getClass method to protect against getting the class of…
spacether Dec 19, 2023
ad7d117
Adds Nullable to arg input of KeywordValidator
spacether Dec 19, 2023
8608c14
Fixes type issues in JsonSchema.java
spacether Dec 19, 2023
323f3d0
Adds Nullable return for KeywordValidator validate
spacether Dec 19, 2023
2bb63d6
Adds supression of seaierliazable class warnings
spacether Dec 19, 2023
ca45968
Adds @Nullable as the return type of shcema getNewInstance with objec…
spacether Dec 19, 2023
f846c80
Adds more nullable annotations
spacether Dec 19, 2023
557b201
Updates FrozenMap to fix type issues
spacether Dec 19, 2023
a892b10
Fixes type issues in ListJsonschema
spacether Dec 19, 2023
565c8c2
Fixes MapJsonSchema
spacether Dec 19, 2023
96b1a41
Fixes type errors in AnyType/UnsetAnyType/NotAnyType schemas
spacether Dec 19, 2023
1810360
Fixes type issue in RequiredValidator
spacether Dec 19, 2023
3a1e0e8
Fixes type issues in RequiredValidator
spacether Dec 19, 2023
eb309ac
Removes getConstraint from validators
spacether Dec 19, 2023
e18987c
Updates EnumValidator
spacether Dec 20, 2023
88cc1d4
Updates UniqueItemsValidator
spacether Dec 20, 2023
5b3b5f8
Fixes EnumValidator by supressing the nullness check on set.contains
spacether Dec 20, 2023
bc6268d
Fixes AdditionalPropertiesValidator
spacether Dec 20, 2023
c00abf3
Fixes JsonSchemaFactory
spacether Dec 20, 2023
6d1b383
Fixes getNewInstance for custom list schemas
spacether Dec 20, 2023
f9f7a85
Improves map schema getNewInstance
spacether Dec 20, 2023
5e9eb20
Improves outputtypes
spacether Dec 20, 2023
ca086b8
Adds throws exceptions to property getters
spacether Dec 20, 2023
8cc8be8
Adds missing exception imports
spacether Dec 20, 2023
2d6615e
Adds type checking protection for required and optional property getters
spacether Dec 20, 2023
0b7099e
Adds NonNull annotation for single outptu types
spacether Dec 20, 2023
66fea18
Fixes throws signatures for getAdditionalProperty
spacether Dec 20, 2023
527dd91
Removes annotations from instanceof checks
spacether Dec 20, 2023
956663a
Removes else condition from if when checking key type
spacether Dec 20, 2023
58eca27
Fixes type errors around property instantiation
spacether Dec 20, 2023
58bac4e
Fixes list item instantiation type errors
spacether Dec 20, 2023
53da703
Changes RuntimeExceptions to InvalidTypeExceptions, fixes NullSchemaT…
spacether Dec 20, 2023
8456fac
Fixes ListSchemaTest
spacether Dec 20, 2023
7fde4b6
Fixes NumberSchemaTest
spacether Dec 20, 2023
9ac8f94
Fixes MapSchemaTest
spacether Dec 20, 2023
6dfde01
Fixes TypeValidatorTest
spacether Dec 20, 2023
d5dc906
Fixes JsonSchemaTest
spacether Dec 20, 2023
110018f
Fixes RequiredValidatorTest
spacether Dec 20, 2023
c272225
Fixes AnyTypeSchemaTest
spacether Dec 20, 2023
63411aa
FIxes ItemsValidatorTest
spacether Dec 20, 2023
c8859ec
Fixes FormatValidatorTest
spacether Dec 20, 2023
288b97a
Fixes AdditionalPropertiesValidatorTest
spacether Dec 20, 2023
4aa597f
Fixes ArrayTypeSchemaTest
spacether Dec 20, 2023
7b71868
Fixes PropertiesValidatorTest
spacether Dec 20, 2023
9834bfe
Removes NonNull
spacether Dec 20, 2023
0861f53
Adds back one needed NonNull
spacether Dec 20, 2023
6a41194
Adds ObjectTypeSchemaTest
spacether Dec 21, 2023
ceb9fa9
Adds Nullable to input types
spacether Dec 21, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Removes annotations from instanceof checks
spacether committed Dec 20, 2023
commit 527dd912bcccdafc5fd39ae6540686226df4b779
Original file line number Diff line number Diff line change
@@ -66,7 +66,11 @@ public static AdditionalpropertiesAllowsASchemaWhichShouldValidateMap of(Map<Str
public boolean getAdditionalProperty(String name) throws UnsetPropertyException, InvalidAdditionalPropertyException {
throwIfKeyKnown(name, requiredKeys, optionalKeys);
throwIfKeyNotPresent(name);
return (boolean) get(name);
@Nullable Object value = get(name);
if (!(value instanceof Boolean)) {
throw new RuntimeException("Invalid value stored for " + name);
}
return (boolean) value;
}
}
public static class AdditionalpropertiesAllowsASchemaWhichShouldValidateMapInput {
Original file line number Diff line number Diff line change
@@ -55,7 +55,7 @@ public static Schema0Map of(Map<String, Object> arg, SchemaConfiguration configu

public long bar() {
@Nullable Object value = get("bar");
if (!(value instanceof @NonNull Long)) {
if (!(value instanceof Long)) {
throw new RuntimeException("Invalid value stored for bar");
}
return (long) value;
@@ -280,7 +280,7 @@ public static Schema1Map of(Map<String, Object> arg, SchemaConfiguration configu

public @NonNull String foo() {
@Nullable Object value = get("foo");
if (!(value instanceof @NonNull String)) {
if (!(value instanceof String)) {
throw new RuntimeException("Invalid value stored for foo");
}
return (@NonNull String) value;
Original file line number Diff line number Diff line change
@@ -56,7 +56,7 @@ public static Schema0Map of(Map<String, Object> arg, SchemaConfiguration configu

public @NonNull String foo() {
@Nullable Object value = get("foo");
if (!(value instanceof @NonNull String)) {
if (!(value instanceof String)) {
throw new RuntimeException("Invalid value stored for foo");
}
return (@NonNull String) value;
@@ -506,7 +506,7 @@ public static AllofWithBaseSchemaMap of(Map<String, Object> arg, SchemaConfigura

public long bar() {
@Nullable Object value = get("bar");
if (!(value instanceof @NonNull Long)) {
if (!(value instanceof Long)) {
throw new RuntimeException("Invalid value stored for bar");
}
return (long) value;
Original file line number Diff line number Diff line change
@@ -55,7 +55,7 @@ public static Schema0Map of(Map<String, Object> arg, SchemaConfiguration configu

public long bar() {
@Nullable Object value = get("bar");
if (!(value instanceof @NonNull Long)) {
if (!(value instanceof Long)) {
throw new RuntimeException("Invalid value stored for bar");
}
return (long) value;
@@ -280,7 +280,7 @@ public static Schema1Map of(Map<String, Object> arg, SchemaConfiguration configu

public @NonNull String foo() {
@Nullable Object value = get("foo");
if (!(value instanceof @NonNull String)) {
if (!(value instanceof String)) {
throw new RuntimeException("Invalid value stored for foo");
}
return (@NonNull String) value;
Original file line number Diff line number Diff line change
@@ -127,7 +127,7 @@ public static EnumsInPropertiesMap of(Map<String, Object> arg, SchemaConfigurati

public @NonNull String bar() {
@Nullable Object value = get("bar");
if (!(value instanceof @NonNull String)) {
if (!(value instanceof String)) {
throw new RuntimeException("Invalid value stored for bar");
}
return (@NonNull String) value;
@@ -136,8 +136,10 @@ public static EnumsInPropertiesMap of(Map<String, Object> arg, SchemaConfigurati
public @NonNull String foo() throws UnsetPropertyException {
String key = "foo";
throwIfKeyNotPresent(key);
@Nullable Object value = get(key);
if (!(value instanceof @NonNull String)) {
// mapValueSchema.typeSchema CodegenSchema{, description&#x3D;&#x27;null&#x27;, jsonPathPiece&#x3D;&#x27;null&#x27;, defaultValue&#x3D;&#x27;null&#x27;, title&#x3D;&#x27;null&#x27;, maxLength&#x3D;null, minLength&#x3D;null, patternInfo&#x3D;&#x27;null&#x27;, example&#x3D;&#x27;null&#x27;, minimum&#x3D;&#x27;null&#x27;, maximum&#x3D;&#x27;null&#x27;, exclusiveMinimum&#x3D;null, exclusiveMaximum&#x3D;null, deprecated&#x3D;null, types&#x3D;null, readOnly&#x3D;null, writeOnly&#x3D;null, nullable&#x3D;null, allowableValues&#x3D;null, items&#x3D;null, additionalProperties&#x3D;null, vendorExtensions&#x3D;null, hasValidation&#x3D;false, maxItems&#x3D;null, minItems&#x3D;null, maxProperties&#x3D;null, minProperties&#x3D;null, uniqueItems&#x3D;null, multipleOf&#x3D;null, xml&#x3D;null, requiredProperties&#x3D;null, optionalProperties&#x3D;null, properties&#x3D;null, refInfo&#x3D;null, schemaIsFromAdditionalProperties&#x3D;false, isBooleanSchemaTrue&#x3D;false, isBooleanSchemaFalse&#x3D;false, format&#x3D;null, dependentRequired&#x3D;null, contains&#x3D;null, allOf&#x3D;null, anyOf&#x3D;null, oneOf&#x3D;null, not&#x3D;null, externalDocumentation&#x3D;null, discriminator&#x3D;null, imports&#x3D;null, componentModule&#x3D;false, testCases&#x3D;{}, instanceType&#x3D;null, jsonPath&#x3D;null, arrayOutputJsonPathPiece&#x3D;null}
// typeSchema CodegenSchema{, description&#x3D;&#x27;null&#x27;, jsonPathPiece&#x3D;&#x27;null&#x27;, defaultValue&#x3D;&#x27;null&#x27;, title&#x3D;&#x27;null&#x27;, maxLength&#x3D;null, minLength&#x3D;null, patternInfo&#x3D;&#x27;null&#x27;, example&#x3D;&#x27;null&#x27;, minimum&#x3D;&#x27;null&#x27;, maximum&#x3D;&#x27;null&#x27;, exclusiveMinimum&#x3D;null, exclusiveMaximum&#x3D;null, deprecated&#x3D;null, types&#x3D;[string], readOnly&#x3D;null, writeOnly&#x3D;null, nullable&#x3D;null, allowableValues&#x3D;org.openapijsonschematools.codegen.generators.openapimodels.EnumInfo@b5093a57, items&#x3D;null, additionalProperties&#x3D;null, vendorExtensions&#x3D;null, hasValidation&#x3D;false, maxItems&#x3D;null, minItems&#x3D;null, maxProperties&#x3D;null, minProperties&#x3D;null, uniqueItems&#x3D;null, multipleOf&#x3D;null, xml&#x3D;null, requiredProperties&#x3D;null, optionalProperties&#x3D;null, properties&#x3D;null, refInfo&#x3D;null, schemaIsFromAdditionalProperties&#x3D;false, isBooleanSchemaTrue&#x3D;false, isBooleanSchemaFalse&#x3D;false, format&#x3D;null, dependentRequired&#x3D;null, contains&#x3D;null, allOf&#x3D;null, anyOf&#x3D;null, oneOf&#x3D;null, not&#x3D;null, externalDocumentation&#x3D;null, discriminator&#x3D;null, imports&#x3D;null, componentModule&#x3D;false, testCases&#x3D;{}, instanceType&#x3D;null, jsonPath&#x3D;null, arrayOutputJsonPathPiece&#x3D;null}
@Nullable Object value = get(key);
if (!(value instanceof String)) {
throw new RuntimeException("Invalid value stored for foo");
}
return (@NonNull String) value;
Original file line number Diff line number Diff line change
@@ -90,8 +90,10 @@ public static InvalidStringValueForDefaultMap of(Map<String, Object> arg, Schema
public @NonNull String bar() throws UnsetPropertyException {
String key = "bar";
throwIfKeyNotPresent(key);
@Nullable Object value = get(key);
if (!(value instanceof @NonNull String)) {
// mapValueSchema.typeSchema CodegenSchema{, description&#x3D;&#x27;null&#x27;, jsonPathPiece&#x3D;&#x27;null&#x27;, defaultValue&#x3D;&#x27;null&#x27;, title&#x3D;&#x27;null&#x27;, maxLength&#x3D;null, minLength&#x3D;null, patternInfo&#x3D;&#x27;null&#x27;, example&#x3D;&#x27;null&#x27;, minimum&#x3D;&#x27;null&#x27;, maximum&#x3D;&#x27;null&#x27;, exclusiveMinimum&#x3D;null, exclusiveMaximum&#x3D;null, deprecated&#x3D;null, types&#x3D;null, readOnly&#x3D;null, writeOnly&#x3D;null, nullable&#x3D;null, allowableValues&#x3D;null, items&#x3D;null, additionalProperties&#x3D;null, vendorExtensions&#x3D;null, hasValidation&#x3D;false, maxItems&#x3D;null, minItems&#x3D;null, maxProperties&#x3D;null, minProperties&#x3D;null, uniqueItems&#x3D;null, multipleOf&#x3D;null, xml&#x3D;null, requiredProperties&#x3D;null, optionalProperties&#x3D;null, properties&#x3D;null, refInfo&#x3D;null, schemaIsFromAdditionalProperties&#x3D;false, isBooleanSchemaTrue&#x3D;false, isBooleanSchemaFalse&#x3D;false, format&#x3D;null, dependentRequired&#x3D;null, contains&#x3D;null, allOf&#x3D;null, anyOf&#x3D;null, oneOf&#x3D;null, not&#x3D;null, externalDocumentation&#x3D;null, discriminator&#x3D;null, imports&#x3D;null, componentModule&#x3D;false, testCases&#x3D;{}, instanceType&#x3D;null, jsonPath&#x3D;null, arrayOutputJsonPathPiece&#x3D;null}
// typeSchema CodegenSchema{, description&#x3D;&#x27;null&#x27;, jsonPathPiece&#x3D;&#x27;null&#x27;, defaultValue&#x3D;&#x27;null&#x27;, title&#x3D;&#x27;null&#x27;, maxLength&#x3D;null, minLength&#x3D;null, patternInfo&#x3D;&#x27;null&#x27;, example&#x3D;&#x27;null&#x27;, minimum&#x3D;&#x27;null&#x27;, maximum&#x3D;&#x27;null&#x27;, exclusiveMinimum&#x3D;null, exclusiveMaximum&#x3D;null, deprecated&#x3D;null, types&#x3D;[string], readOnly&#x3D;null, writeOnly&#x3D;null, nullable&#x3D;null, allowableValues&#x3D;null, items&#x3D;null, additionalProperties&#x3D;null, vendorExtensions&#x3D;null, hasValidation&#x3D;false, maxItems&#x3D;null, minItems&#x3D;null, maxProperties&#x3D;null, minProperties&#x3D;null, uniqueItems&#x3D;null, multipleOf&#x3D;null, xml&#x3D;null, requiredProperties&#x3D;null, optionalProperties&#x3D;null, properties&#x3D;null, refInfo&#x3D;null, schemaIsFromAdditionalProperties&#x3D;false, isBooleanSchemaTrue&#x3D;false, isBooleanSchemaFalse&#x3D;false, format&#x3D;null, dependentRequired&#x3D;null, contains&#x3D;null, allOf&#x3D;null, anyOf&#x3D;null, oneOf&#x3D;null, not&#x3D;null, externalDocumentation&#x3D;null, discriminator&#x3D;null, imports&#x3D;null, componentModule&#x3D;false, testCases&#x3D;{}, instanceType&#x3D;null, jsonPath&#x3D;null, arrayOutputJsonPathPiece&#x3D;null}
@Nullable Object value = get(key);
if (!(value instanceof String)) {
throw new RuntimeException("Invalid value stored for bar");
}
return (@NonNull String) value;
Original file line number Diff line number Diff line change
@@ -55,8 +55,10 @@ public static NotMap of(Map<String, Object> arg, SchemaConfiguration configurati
public @NonNull String foo() throws UnsetPropertyException {
String key = "foo";
throwIfKeyNotPresent(key);
@Nullable Object value = get(key);
if (!(value instanceof @NonNull String)) {
// mapValueSchema.typeSchema CodegenSchema{, description&#x3D;&#x27;null&#x27;, jsonPathPiece&#x3D;&#x27;null&#x27;, defaultValue&#x3D;&#x27;null&#x27;, title&#x3D;&#x27;null&#x27;, maxLength&#x3D;null, minLength&#x3D;null, patternInfo&#x3D;&#x27;null&#x27;, example&#x3D;&#x27;null&#x27;, minimum&#x3D;&#x27;null&#x27;, maximum&#x3D;&#x27;null&#x27;, exclusiveMinimum&#x3D;null, exclusiveMaximum&#x3D;null, deprecated&#x3D;null, types&#x3D;null, readOnly&#x3D;null, writeOnly&#x3D;null, nullable&#x3D;null, allowableValues&#x3D;null, items&#x3D;null, additionalProperties&#x3D;null, vendorExtensions&#x3D;null, hasValidation&#x3D;false, maxItems&#x3D;null, minItems&#x3D;null, maxProperties&#x3D;null, minProperties&#x3D;null, uniqueItems&#x3D;null, multipleOf&#x3D;null, xml&#x3D;null, requiredProperties&#x3D;null, optionalProperties&#x3D;null, properties&#x3D;null, refInfo&#x3D;null, schemaIsFromAdditionalProperties&#x3D;false, isBooleanSchemaTrue&#x3D;false, isBooleanSchemaFalse&#x3D;false, format&#x3D;null, dependentRequired&#x3D;null, contains&#x3D;null, allOf&#x3D;null, anyOf&#x3D;null, oneOf&#x3D;null, not&#x3D;null, externalDocumentation&#x3D;null, discriminator&#x3D;null, imports&#x3D;null, componentModule&#x3D;false, testCases&#x3D;{}, instanceType&#x3D;null, jsonPath&#x3D;null, arrayOutputJsonPathPiece&#x3D;null}
// typeSchema CodegenSchema{, description&#x3D;&#x27;null&#x27;, jsonPathPiece&#x3D;&#x27;null&#x27;, defaultValue&#x3D;&#x27;null&#x27;, title&#x3D;&#x27;null&#x27;, maxLength&#x3D;null, minLength&#x3D;null, patternInfo&#x3D;&#x27;null&#x27;, example&#x3D;&#x27;null&#x27;, minimum&#x3D;&#x27;null&#x27;, maximum&#x3D;&#x27;null&#x27;, exclusiveMinimum&#x3D;null, exclusiveMaximum&#x3D;null, deprecated&#x3D;null, types&#x3D;[string], readOnly&#x3D;null, writeOnly&#x3D;null, nullable&#x3D;null, allowableValues&#x3D;null, items&#x3D;null, additionalProperties&#x3D;null, vendorExtensions&#x3D;null, hasValidation&#x3D;false, maxItems&#x3D;null, minItems&#x3D;null, maxProperties&#x3D;null, minProperties&#x3D;null, uniqueItems&#x3D;null, multipleOf&#x3D;null, xml&#x3D;null, requiredProperties&#x3D;null, optionalProperties&#x3D;null, properties&#x3D;null, refInfo&#x3D;null, schemaIsFromAdditionalProperties&#x3D;false, isBooleanSchemaTrue&#x3D;false, isBooleanSchemaFalse&#x3D;false, format&#x3D;null, dependentRequired&#x3D;null, contains&#x3D;null, allOf&#x3D;null, anyOf&#x3D;null, oneOf&#x3D;null, not&#x3D;null, externalDocumentation&#x3D;null, discriminator&#x3D;null, imports&#x3D;null, componentModule&#x3D;false, testCases&#x3D;{}, instanceType&#x3D;null, jsonPath&#x3D;null, arrayOutputJsonPathPiece&#x3D;null}
@Nullable Object value = get(key);
if (!(value instanceof String)) {
throw new RuntimeException("Invalid value stored for foo");
}
return (@NonNull String) value;
Original file line number Diff line number Diff line change
@@ -60,8 +60,10 @@ public static ObjectPropertiesValidationMap of(Map<String, Object> arg, SchemaCo
public long foo() throws UnsetPropertyException {
String key = "foo";
throwIfKeyNotPresent(key);
@Nullable Object value = get(key);
if (!(value instanceof @NonNull Long)) {
// mapValueSchema.typeSchema CodegenSchema{, description&#x3D;&#x27;null&#x27;, jsonPathPiece&#x3D;&#x27;null&#x27;, defaultValue&#x3D;&#x27;null&#x27;, title&#x3D;&#x27;null&#x27;, maxLength&#x3D;null, minLength&#x3D;null, patternInfo&#x3D;&#x27;null&#x27;, example&#x3D;&#x27;null&#x27;, minimum&#x3D;&#x27;null&#x27;, maximum&#x3D;&#x27;null&#x27;, exclusiveMinimum&#x3D;null, exclusiveMaximum&#x3D;null, deprecated&#x3D;null, types&#x3D;null, readOnly&#x3D;null, writeOnly&#x3D;null, nullable&#x3D;null, allowableValues&#x3D;null, items&#x3D;null, additionalProperties&#x3D;null, vendorExtensions&#x3D;null, hasValidation&#x3D;false, maxItems&#x3D;null, minItems&#x3D;null, maxProperties&#x3D;null, minProperties&#x3D;null, uniqueItems&#x3D;null, multipleOf&#x3D;null, xml&#x3D;null, requiredProperties&#x3D;null, optionalProperties&#x3D;null, properties&#x3D;null, refInfo&#x3D;null, schemaIsFromAdditionalProperties&#x3D;false, isBooleanSchemaTrue&#x3D;false, isBooleanSchemaFalse&#x3D;false, format&#x3D;null, dependentRequired&#x3D;null, contains&#x3D;null, allOf&#x3D;null, anyOf&#x3D;null, oneOf&#x3D;null, not&#x3D;null, externalDocumentation&#x3D;null, discriminator&#x3D;null, imports&#x3D;null, componentModule&#x3D;false, testCases&#x3D;{}, instanceType&#x3D;null, jsonPath&#x3D;null, arrayOutputJsonPathPiece&#x3D;null}
// typeSchema CodegenSchema{, description&#x3D;&#x27;null&#x27;, jsonPathPiece&#x3D;&#x27;null&#x27;, defaultValue&#x3D;&#x27;null&#x27;, title&#x3D;&#x27;null&#x27;, maxLength&#x3D;null, minLength&#x3D;null, patternInfo&#x3D;&#x27;null&#x27;, example&#x3D;&#x27;null&#x27;, minimum&#x3D;&#x27;null&#x27;, maximum&#x3D;&#x27;null&#x27;, exclusiveMinimum&#x3D;null, exclusiveMaximum&#x3D;null, deprecated&#x3D;null, types&#x3D;[integer], readOnly&#x3D;null, writeOnly&#x3D;null, nullable&#x3D;null, allowableValues&#x3D;null, items&#x3D;null, additionalProperties&#x3D;null, vendorExtensions&#x3D;null, hasValidation&#x3D;false, maxItems&#x3D;null, minItems&#x3D;null, maxProperties&#x3D;null, minProperties&#x3D;null, uniqueItems&#x3D;null, multipleOf&#x3D;null, xml&#x3D;null, requiredProperties&#x3D;null, optionalProperties&#x3D;null, properties&#x3D;null, refInfo&#x3D;null, schemaIsFromAdditionalProperties&#x3D;false, isBooleanSchemaTrue&#x3D;false, isBooleanSchemaFalse&#x3D;false, format&#x3D;null, dependentRequired&#x3D;null, contains&#x3D;null, allOf&#x3D;null, anyOf&#x3D;null, oneOf&#x3D;null, not&#x3D;null, externalDocumentation&#x3D;null, discriminator&#x3D;null, imports&#x3D;null, componentModule&#x3D;false, testCases&#x3D;{}, instanceType&#x3D;null, jsonPath&#x3D;null, arrayOutputJsonPathPiece&#x3D;null}
@Nullable Object value = get(key);
if (!(value instanceof Long)) {
throw new RuntimeException("Invalid value stored for foo");
}
return (long) value;
@@ -70,8 +72,10 @@ public long foo() throws UnsetPropertyException {
public @NonNull String bar() throws UnsetPropertyException {
String key = "bar";
throwIfKeyNotPresent(key);
@Nullable Object value = get(key);
if (!(value instanceof @NonNull String)) {
// mapValueSchema.typeSchema CodegenSchema{, description&#x3D;&#x27;null&#x27;, jsonPathPiece&#x3D;&#x27;null&#x27;, defaultValue&#x3D;&#x27;null&#x27;, title&#x3D;&#x27;null&#x27;, maxLength&#x3D;null, minLength&#x3D;null, patternInfo&#x3D;&#x27;null&#x27;, example&#x3D;&#x27;null&#x27;, minimum&#x3D;&#x27;null&#x27;, maximum&#x3D;&#x27;null&#x27;, exclusiveMinimum&#x3D;null, exclusiveMaximum&#x3D;null, deprecated&#x3D;null, types&#x3D;null, readOnly&#x3D;null, writeOnly&#x3D;null, nullable&#x3D;null, allowableValues&#x3D;null, items&#x3D;null, additionalProperties&#x3D;null, vendorExtensions&#x3D;null, hasValidation&#x3D;false, maxItems&#x3D;null, minItems&#x3D;null, maxProperties&#x3D;null, minProperties&#x3D;null, uniqueItems&#x3D;null, multipleOf&#x3D;null, xml&#x3D;null, requiredProperties&#x3D;null, optionalProperties&#x3D;null, properties&#x3D;null, refInfo&#x3D;null, schemaIsFromAdditionalProperties&#x3D;false, isBooleanSchemaTrue&#x3D;false, isBooleanSchemaFalse&#x3D;false, format&#x3D;null, dependentRequired&#x3D;null, contains&#x3D;null, allOf&#x3D;null, anyOf&#x3D;null, oneOf&#x3D;null, not&#x3D;null, externalDocumentation&#x3D;null, discriminator&#x3D;null, imports&#x3D;null, componentModule&#x3D;false, testCases&#x3D;{}, instanceType&#x3D;null, jsonPath&#x3D;null, arrayOutputJsonPathPiece&#x3D;null}
// typeSchema CodegenSchema{, description&#x3D;&#x27;null&#x27;, jsonPathPiece&#x3D;&#x27;null&#x27;, defaultValue&#x3D;&#x27;null&#x27;, title&#x3D;&#x27;null&#x27;, maxLength&#x3D;null, minLength&#x3D;null, patternInfo&#x3D;&#x27;null&#x27;, example&#x3D;&#x27;null&#x27;, minimum&#x3D;&#x27;null&#x27;, maximum&#x3D;&#x27;null&#x27;, exclusiveMinimum&#x3D;null, exclusiveMaximum&#x3D;null, deprecated&#x3D;null, types&#x3D;[string], readOnly&#x3D;null, writeOnly&#x3D;null, nullable&#x3D;null, allowableValues&#x3D;null, items&#x3D;null, additionalProperties&#x3D;null, vendorExtensions&#x3D;null, hasValidation&#x3D;false, maxItems&#x3D;null, minItems&#x3D;null, maxProperties&#x3D;null, minProperties&#x3D;null, uniqueItems&#x3D;null, multipleOf&#x3D;null, xml&#x3D;null, requiredProperties&#x3D;null, optionalProperties&#x3D;null, properties&#x3D;null, refInfo&#x3D;null, schemaIsFromAdditionalProperties&#x3D;false, isBooleanSchemaTrue&#x3D;false, isBooleanSchemaFalse&#x3D;false, format&#x3D;null, dependentRequired&#x3D;null, contains&#x3D;null, allOf&#x3D;null, anyOf&#x3D;null, oneOf&#x3D;null, not&#x3D;null, externalDocumentation&#x3D;null, discriminator&#x3D;null, imports&#x3D;null, componentModule&#x3D;false, testCases&#x3D;{}, instanceType&#x3D;null, jsonPath&#x3D;null, arrayOutputJsonPathPiece&#x3D;null}
@Nullable Object value = get(key);
if (!(value instanceof String)) {
throw new RuntimeException("Invalid value stored for bar");
}
return (@NonNull String) value;
Original file line number Diff line number Diff line change
@@ -55,7 +55,7 @@ public static Schema0Map of(Map<String, Object> arg, SchemaConfiguration configu

public long bar() {
@Nullable Object value = get("bar");
if (!(value instanceof @NonNull Long)) {
if (!(value instanceof Long)) {
throw new RuntimeException("Invalid value stored for bar");
}
return (long) value;
@@ -280,7 +280,7 @@ public static Schema1Map of(Map<String, Object> arg, SchemaConfiguration configu

public @NonNull String foo() {
@Nullable Object value = get("foo");
if (!(value instanceof @NonNull String)) {
if (!(value instanceof String)) {
throw new RuntimeException("Invalid value stored for foo");
}
return (@NonNull String) value;
Original file line number Diff line number Diff line change
@@ -51,8 +51,10 @@ public static RefInPropertyMap of(Map<String, Object> arg, SchemaConfiguration c
public @Nullable Object a() throws UnsetPropertyException {
String key = "a";
throwIfKeyNotPresent(key);
@Nullable Object value = get(key);
if (!(value instanceof @Nullable Object)) {
// mapValueSchema.typeSchema CodegenSchema{, description&#x3D;&#x27;null&#x27;, jsonPathPiece&#x3D;&#x27;null&#x27;, defaultValue&#x3D;&#x27;null&#x27;, title&#x3D;&#x27;null&#x27;, maxLength&#x3D;null, minLength&#x3D;null, patternInfo&#x3D;&#x27;null&#x27;, example&#x3D;&#x27;null&#x27;, minimum&#x3D;&#x27;null&#x27;, maximum&#x3D;&#x27;null&#x27;, exclusiveMinimum&#x3D;null, exclusiveMaximum&#x3D;null, deprecated&#x3D;null, types&#x3D;null, readOnly&#x3D;null, writeOnly&#x3D;null, nullable&#x3D;null, allowableValues&#x3D;null, items&#x3D;null, additionalProperties&#x3D;null, vendorExtensions&#x3D;null, hasValidation&#x3D;false, maxItems&#x3D;null, minItems&#x3D;null, maxProperties&#x3D;null, minProperties&#x3D;null, uniqueItems&#x3D;null, multipleOf&#x3D;null, xml&#x3D;null, requiredProperties&#x3D;null, optionalProperties&#x3D;null, properties&#x3D;null, refInfo&#x3D;null, schemaIsFromAdditionalProperties&#x3D;false, isBooleanSchemaTrue&#x3D;false, isBooleanSchemaFalse&#x3D;false, format&#x3D;null, dependentRequired&#x3D;null, contains&#x3D;null, allOf&#x3D;null, anyOf&#x3D;null, oneOf&#x3D;null, not&#x3D;null, externalDocumentation&#x3D;null, discriminator&#x3D;null, imports&#x3D;null, componentModule&#x3D;false, testCases&#x3D;{}, instanceType&#x3D;null, jsonPath&#x3D;null, arrayOutputJsonPathPiece&#x3D;null}
// typeSchema CodegenSchema{, description&#x3D;&#x27;null&#x27;, jsonPathPiece&#x3D;&#x27;null&#x27;, defaultValue&#x3D;&#x27;null&#x27;, title&#x3D;&#x27;null&#x27;, maxLength&#x3D;null, minLength&#x3D;null, patternInfo&#x3D;&#x27;null&#x27;, example&#x3D;&#x27;null&#x27;, minimum&#x3D;&#x27;null&#x27;, maximum&#x3D;&#x27;null&#x27;, exclusiveMinimum&#x3D;null, exclusiveMaximum&#x3D;null, deprecated&#x3D;null, types&#x3D;null, readOnly&#x3D;null, writeOnly&#x3D;null, nullable&#x3D;null, allowableValues&#x3D;null, items&#x3D;null, additionalProperties&#x3D;null, vendorExtensions&#x3D;null, hasValidation&#x3D;false, maxItems&#x3D;null, minItems&#x3D;null, maxProperties&#x3D;null, minProperties&#x3D;null, uniqueItems&#x3D;null, multipleOf&#x3D;null, xml&#x3D;null, requiredProperties&#x3D;null, optionalProperties&#x3D;null, properties&#x3D;null, refInfo&#x3D;CodegenRefInfo{refModule&#x3D;PropertyNamedRefThatIsNotAReference, refClass&#x3D;PropertyNamedRefThatIsNotAReference1, refModuleLocation&#x3D;org.openapijsonschematools.client.components.schemas, refModuleAlias&#x3D;null}, schemaIsFromAdditionalProperties&#x3D;false, isBooleanSchemaTrue&#x3D;false, isBooleanSchemaFalse&#x3D;false, format&#x3D;null, dependentRequired&#x3D;null, contains&#x3D;null, allOf&#x3D;null, anyOf&#x3D;null, oneOf&#x3D;null, not&#x3D;null, externalDocumentation&#x3D;null, discriminator&#x3D;null, imports&#x3D;null, componentModule&#x3D;false, testCases&#x3D;{}, instanceType&#x3D;null, jsonPath&#x3D;null, arrayOutputJsonPathPiece&#x3D;null}
@Nullable Object value = get(key);
if (!(value instanceof Object)) {
throw new RuntimeException("Invalid value stored for a");
}
return (@Nullable Object) value;
Original file line number Diff line number Diff line change
@@ -100,8 +100,10 @@ public static TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingMap of(Map
public @NonNull Number alpha() throws UnsetPropertyException {
String key = "alpha";
throwIfKeyNotPresent(key);
@Nullable Object value = get(key);
if (!(value instanceof @NonNull Number)) {
// mapValueSchema.typeSchema CodegenSchema{, description&#x3D;&#x27;null&#x27;, jsonPathPiece&#x3D;&#x27;null&#x27;, defaultValue&#x3D;&#x27;null&#x27;, title&#x3D;&#x27;null&#x27;, maxLength&#x3D;null, minLength&#x3D;null, patternInfo&#x3D;&#x27;null&#x27;, example&#x3D;&#x27;null&#x27;, minimum&#x3D;&#x27;null&#x27;, maximum&#x3D;&#x27;null&#x27;, exclusiveMinimum&#x3D;null, exclusiveMaximum&#x3D;null, deprecated&#x3D;null, types&#x3D;null, readOnly&#x3D;null, writeOnly&#x3D;null, nullable&#x3D;null, allowableValues&#x3D;null, items&#x3D;null, additionalProperties&#x3D;null, vendorExtensions&#x3D;null, hasValidation&#x3D;false, maxItems&#x3D;null, minItems&#x3D;null, maxProperties&#x3D;null, minProperties&#x3D;null, uniqueItems&#x3D;null, multipleOf&#x3D;null, xml&#x3D;null, requiredProperties&#x3D;null, optionalProperties&#x3D;null, properties&#x3D;null, refInfo&#x3D;null, schemaIsFromAdditionalProperties&#x3D;false, isBooleanSchemaTrue&#x3D;false, isBooleanSchemaFalse&#x3D;false, format&#x3D;null, dependentRequired&#x3D;null, contains&#x3D;null, allOf&#x3D;null, anyOf&#x3D;null, oneOf&#x3D;null, not&#x3D;null, externalDocumentation&#x3D;null, discriminator&#x3D;null, imports&#x3D;null, componentModule&#x3D;false, testCases&#x3D;{}, instanceType&#x3D;null, jsonPath&#x3D;null, arrayOutputJsonPathPiece&#x3D;null}
// typeSchema CodegenSchema{, description&#x3D;&#x27;null&#x27;, jsonPathPiece&#x3D;&#x27;null&#x27;, defaultValue&#x3D;&#x27;null&#x27;, title&#x3D;&#x27;null&#x27;, maxLength&#x3D;null, minLength&#x3D;null, patternInfo&#x3D;&#x27;null&#x27;, example&#x3D;&#x27;null&#x27;, minimum&#x3D;&#x27;null&#x27;, maximum&#x3D;&#x27;null&#x27;, exclusiveMinimum&#x3D;null, exclusiveMaximum&#x3D;null, deprecated&#x3D;null, types&#x3D;[number], readOnly&#x3D;null, writeOnly&#x3D;null, nullable&#x3D;null, allowableValues&#x3D;null, items&#x3D;null, additionalProperties&#x3D;null, vendorExtensions&#x3D;null, hasValidation&#x3D;false, maxItems&#x3D;null, minItems&#x3D;null, maxProperties&#x3D;null, minProperties&#x3D;null, uniqueItems&#x3D;null, multipleOf&#x3D;null, xml&#x3D;null, requiredProperties&#x3D;null, optionalProperties&#x3D;null, properties&#x3D;null, refInfo&#x3D;null, schemaIsFromAdditionalProperties&#x3D;false, isBooleanSchemaTrue&#x3D;false, isBooleanSchemaFalse&#x3D;false, format&#x3D;null, dependentRequired&#x3D;null, contains&#x3D;null, allOf&#x3D;null, anyOf&#x3D;null, oneOf&#x3D;null, not&#x3D;null, externalDocumentation&#x3D;null, discriminator&#x3D;null, imports&#x3D;null, componentModule&#x3D;false, testCases&#x3D;{}, instanceType&#x3D;null, jsonPath&#x3D;null, arrayOutputJsonPathPiece&#x3D;null}
@Nullable Object value = get(key);
if (!(value instanceof Number)) {
throw new RuntimeException("Invalid value stored for alpha");
}
return (@NonNull Number) value;
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@
return get("{{{@key.original}}}");
{{else}}
{{#with ../../mapValueSchema}}{{> src/main/java/packagename/components/schemas/types/schema_output_type fullRefModule="" }}{{/with}} value = get("{{{@key.original}}}");
if (!(value instanceof {{> src/main/java/packagename/components/schemas/types/schema_output_type fullRefModule="" forceNull=true }})) {
if (!(value instanceof {{> src/main/java/packagename/components/schemas/types/schema_output_type fullRefModule="" forceNull=true noAnnotations=true }})) {
throw new RuntimeException("Invalid value stored for {{{@key.original}}}");
}
return ({{> src/main/java/packagename/components/schemas/types/schema_output_type fullRefModule="" }}) value;
@@ -14,8 +14,10 @@ throwIfKeyNotPresent(key);
{{#and ../../mapValueSchema (eq typeSchema ../../mapValueSchema.typeSchema) }}
return get(key);
{{else}}
// mapValueSchema.typeSchema {{../../mapValueSchema.typeSchema}}
// typeSchema {{typeSchema}}
{{#with ../../mapValueSchema}}{{> src/main/java/packagename/components/schemas/types/schema_output_type fullRefModule="" }}{{/with}} value = get(key);
if (!(value instanceof {{> src/main/java/packagename/components/schemas/types/schema_output_type fullRefModule="" forceNull=true }})) {
if (!(value instanceof {{> src/main/java/packagename/components/schemas/types/schema_output_type fullRefModule="" forceNull=true noAnnotations=true }})) {
throw new RuntimeException("Invalid value stored for {{{@key.original}}}");
}
return ({{> src/main/java/packagename/components/schemas/types/schema_output_type fullRefModule="" }}) value;
Original file line number Diff line number Diff line change
@@ -58,7 +58,11 @@ public {{> src/main/java/packagename/components/schemas/types/schema_output_type
{{#and ../../mapValueSchema (eq typeSchema ../../mapValueSchema.typeSchema) }}
return get(name);
{{else}}
return ({{> src/main/java/packagename/components/schemas/types/schema_output_type fullRefModule="" }}) get(name);
{{#with ../../mapValueSchema}}{{> src/main/java/packagename/components/schemas/types/schema_output_type fullRefModule="" }}{{/with}} value = get(name);
if (!(value instanceof {{> src/main/java/packagename/components/schemas/types/schema_output_type fullRefModule="" forceNull=true noAnnotations=true }})) {
throw new RuntimeException("Invalid value stored for " + name);
}
return ({{> src/main/java/packagename/components/schemas/types/schema_output_type fullRefModule="" }}) value;
{{/and}}
}
{{/unless}}
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@
{{#each types}}
{{#eq this "boolean"}}
{{#if forceNull}}
@NonNull Boolean
{{#unless noAnnotations}}@NonNull {{/unless}}Boolean
{{~else}}
boolean
{{~/if}}
@@ -16,37 +16,37 @@ Void
{{! todo binary types}}
String
{{~else}}
@NonNull String
{{#unless noAnnotations}}@NonNull {{/unless}}String
{{~/eq}}
{{else}}
{{#eq this "number"}}
{{#eq ../format null}}
@NonNull Number
{{#unless noAnnotations}}@NonNull {{/unless}}Number
{{~else}}
{{#eq ../format "float"}}
{{#if forceNull}}
@NonNull Float
{{#unless noAnnotations}}@NonNull {{/unless}}Float
{{~else}}
float
{{~/if}}
{{else}}
{{#eq ../format "double"}}
{{#if forceNull}}
@NonNull Double
{{#unless noAnnotations}}@NonNull {{/unless}}Double
{{~else}}
double
{{~/if}}
{{else}}
{{#eq ../format "int32"}}
{{#if forceNull}}
@NonNull Integer
{{#unless noAnnotations}}@NonNull {{/unless}}Integer
{{~else}}
int
{{~/if}}
{{else}}
{{#eq ../format "int64"}}
{{#if forceNull}}
@NonNull Long
{{#unless noAnnotations}}@NonNull {{/unless}}Long
{{~else}}
long
{{~/if}}
@@ -59,21 +59,21 @@ long
{{#eq this "integer"}}
{{#eq ../format null}}
{{#if forceNull}}
@NonNull Long
{{#unless noAnnotations}}@NonNull {{/unless}}Long
{{~else}}
long
{{~/if}}
{{else}}
{{#eq ../format "int32"}}
{{#if forceNull}}
@NonNull Integer
{{#unless noAnnotations}}@NonNull {{/unless}}Integer
{{~else}}
int
{{~/if}}
{{else}}
{{#eq ../format "int64"}}
{{#if forceNull}}
@NonNull Long
{{#unless noAnnotations}}@NonNull {{/unless}}Long
{{~else}}
long
{{~/if}}
@@ -91,13 +91,13 @@ long
{{~/if}}
{{else}}
{{#if fullRefModule}}
@NonNull {{fullRefModule}}.{{arrayOutputJsonPathPiece.camelCase}}
{{#unless noAnnotations}}@NonNull {{/unless}}{{fullRefModule}}.{{arrayOutputJsonPathPiece.camelCase}}
{{~else}}
@NonNull {{arrayOutputJsonPathPiece.camelCase}}
{{#unless noAnnotations}}@NonNull {{/unless}}{{arrayOutputJsonPathPiece.camelCase}}
{{~/if}}
{{/if}}
{{else}}
@NonNull FrozenList<@Nullable Object>
{{#unless noAnnotations}}@NonNull {{/unless}}FrozenList<@Nullable Object>
{{~/if}}
{{else}}
{{#eq this "object"}}
@@ -110,13 +110,13 @@ long
{{~/if}}
{{else}}
{{#if fullRefModule}}
@NonNull {{fullRefModule}}.{{mapOutputJsonPathPiece.camelCase}}
{{#unless noAnnotations}}@NonNull {{/unless}}{{fullRefModule}}.{{mapOutputJsonPathPiece.camelCase}}
{{~else}}
@NonNull {{mapOutputJsonPathPiece.camelCase}}
{{#unless noAnnotations}}@NonNull {{/unless}}{{mapOutputJsonPathPiece.camelCase}}
{{~/if}}
{{/if}}
{{~else}}
@NonNull FrozenMap<@Nullable Object>
{{#unless noAnnotations}}@NonNull {{/unless}}FrozenMap<@Nullable Object>
{{~/if}}
{{/eq}}
{{/eq}}
@@ -132,31 +132,31 @@ long
{{! nullable types }}
{{#each types}}
{{#eq this "boolean"}}
@Nullable Boolean
{{#unless noAnnotations}}@Nullable {{/unless}}Boolean
{{~else}}
{{#eq this "string"}}
{{#eq format "binary"}}
{{! todo binary types}}
@Nullable String
{{#unless noAnnotations}}@Nullable {{/unless}}String
{{~else}}
@Nullable String
{{#unless noAnnotations}}@Nullable {{/unless}}String
{{~/eq}}
{{else}}
{{#eq this "number"}}
{{#eq ../format null}}
@Nullable Number
{{#unless noAnnotations}}@Nullable {{/unless}}Number
{{~else}}
{{#eq ../format "float"}}
@Nullable Float
{{#unless noAnnotations}}@Nullable {{/unless}}Float
{{~else}}
{{#eq ../format "double"}}
@Nullable Double
{{#unless noAnnotations}}@Nullable {{/unless}}Double
{{~else}}
{{#eq ../format "int32"}}
@Nullable Integer
{{#unless noAnnotations}}@Nullable {{/unless}}Integer
{{~else}}
{{#eq ../format "int64"}}
@Nullable Long
{{#unless noAnnotations}}@Nullable {{/unless}}Long
{{~/eq}}
{{/eq}}
{{/eq}}
@@ -165,13 +165,13 @@ long
{{else}}
{{#eq this "integer"}}
{{#eq ../format null}}
@Nullable Long
{{#unless noAnnotations}}@Nullable {{/unless}}Long
{{~else}}
{{#eq ../format "int32"}}
@Nullable Integer
{{#unless noAnnotations}}@Nullable {{/unless}}Integer
{{~else}}
{{#eq ../format "int64"}}
@Nullable Long
{{#unless noAnnotations}}@Nullable {{/unless}}Long
{{~/eq}}
{{/eq}}
{{/eq}}
@@ -186,13 +186,13 @@ long
{{~/if}}
{{else}}
{{#if fullRefModule}}
@Nullable {{fullRefModule}}.{{arrayOutputJsonPathPiece.camelCase}}
{{#unless noAnnotations}}@Nullable {{/unless}}{{fullRefModule}}.{{arrayOutputJsonPathPiece.camelCase}}
{{~else}}
@Nullable {{arrayOutputJsonPathPiece.camelCase}}
{{#unless noAnnotations}}@Nullable {{/unless}}{{arrayOutputJsonPathPiece.camelCase}}
{{~/if}}
{{/if}}
{{else}}
@Nullable FrozenList<@Nullable Object>
{{#unless noAnnotations}}@Nullable {{/unless}}FrozenList<@Nullable Object>
{{~/if}}
{{else}}
{{#eq this "object"}}
@@ -205,13 +205,13 @@ long
{{~/if}}
{{else}}
{{#if fullRefModule}}
@Nullable {{fullRefModule}}.{{mapOutputJsonPathPiece.camelCase}}
{{#unless noAnnotations}}@Nullable {{/unless}}{{fullRefModule}}.{{mapOutputJsonPathPiece.camelCase}}
{{~else}}
@Nullable {{mapOutputJsonPathPiece.camelCase}}
{{#unless noAnnotations}}@Nullable {{/unless}}{{mapOutputJsonPathPiece.camelCase}}
{{~/if}}
{{/if}}
{{~else}}
@Nullable FrozenMap<@Nullable Object>
{{#unless noAnnotations}}@Nullable {{/unless}}FrozenMap<@Nullable Object>
{{~/if}}
{{/eq}}
{{/eq}}
@@ -231,12 +231,12 @@ Object
{{else}}
{{! 3 or more types }}
{{#contains types "null"}}
@Nullable Object
{{#unless noAnnotations}}@Nullable {{/unless}}Object
{{else}}
Object
{{/contains}}
{{~/eq}}
{{/eq}}
{{else}}
@Nullable Object
{{#unless noAnnotations}}@Nullable {{/unless}}Object
{{~/if}}